Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New rule L069: Consistent syntax for sql type casting #3747

Merged

Conversation

bolajiwahab
Copy link
Contributor

@bolajiwahab bolajiwahab commented Aug 15, 2022

Brief summary of the change made

Fixes #3713

Are there any other side effects of this change that we should be aware of?

Had to regenerate all fixtures that included cast_expression.

Pull Request checklist

  • Please confirm you have completed any of the necessary steps below.

  • Included test cases to demonstrate any code changes, which may be one or more of the following:

    • .yml rule test cases in test/fixtures/rules/std_rule_cases.
    • .sql/.yml parser test cases in test/fixtures/dialects (note YML files can be auto generated with tox -e generate-fixture-yml).
    • Full autofix test cases in test/fixtures/linter/autofix.
    • Other.
  • Added appropriate documentation for the change.

  • Created GitHub issues for any relevant followup/future enhancements if appropriate.

@bolajiwahab bolajiwahab changed the title Consistent syntax for sql type casting Rule L0069: Consistent syntax for sql type casting Aug 15, 2022
@bolajiwahab bolajiwahab changed the title Rule L0069: Consistent syntax for sql type casting New rule L069: Consistent syntax for sql type casting Aug 15, 2022
@codecov
Copy link

codecov bot commented Aug 17, 2022

Codecov Report

Base: 100.00% // Head: 100.00% // No change to project coverage 👍

Coverage data is based on head (5d30c05) compared to base (f4b51b6).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##              main     #3747    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files          190       191     +1     
  Lines        14591     14718   +127     
==========================================
+ Hits         14591     14718   +127     
Impacted Files Coverage Δ
src/sqlfluff/core/rules/config_info.py 100.00% <ø> (ø)
src/sqlfluff/dialects/dialect_ansi.py 100.00% <ø> (ø)
src/sqlfluff/rules/L034.py 100.00% <ø> (ø)
src/sqlfluff/rules/L013.py 100.00% <100.00%> (ø)
src/sqlfluff/rules/L069.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@bolajiwahab
Copy link
Contributor Author

@barrywhart and @alanmcruickshank if you have some spare time, can you review this PR? Thanks

@barrywhart
Copy link
Member

Thanks for letting me know. There's no pressure, I was just looking over the list of PRs yesterday and was curious. 🙏

@bolajiwahab
Copy link
Contributor Author

Thanks for letting me know. There's no pressure, I was just looking over the list of PRs yesterday and was curious. 🙏

Been quite hung up with a few things. I will find time this weekend to finish it up.

@barrywhart
Copy link
Member

A few lines of the rule are not covered by the tests. If it's reasonable to test those, that's good. If not, we add # pragma: no coverto get the coverage check to pass.

@bolajiwahab
Copy link
Contributor Author

A few lines of the rule are not covered by the tests. If it's reasonable to test those, that's good. If not, we add # pragma: no coverto get the coverage check to pass.

Yeah, looking into those.

@bolajiwahab
Copy link
Contributor Author

bolajiwahab commented Nov 12, 2022

@barrywhart You may review the PR now. Thank you.

@barrywhart
Copy link
Member

@OTooleMichael: You had requested changes on this PR. Can you review it again?

@tunetheweb: Can you please review the small dialect change to this PR?

src/sqlfluff/dialects/dialect_ansi.py Outdated Show resolved Hide resolved
src/sqlfluff/dialects/dialect_ansi.py Show resolved Hide resolved
src/sqlfluff/dialects/dialect_ansi.py Outdated Show resolved Hide resolved
bolajiwahab and others added 4 commits November 15, 2022 22:10
Co-authored-by: Barry Pollard <barrypollard@google.com>
Co-authored-by: Barry Pollard <barrypollard@google.com>
Co-authored-by: Barry Pollard <barrypollard@google.com>
@barrywhart barrywhart dismissed OTooleMichael’s stale review November 15, 2022 23:50

Many changes since then, asked him to review again but haven't heard back

Copy link
Member

@tunetheweb tunetheweb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@barrywhart barrywhart merged commit fe77193 into sqlfluff:main Nov 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a rule to enforce consistent syntax for SQL type casting
4 participants