-
-
Notifications
You must be signed in to change notification settings - Fork 729
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
Fix extra underscores in case rules (L010 and L014) #1396
Fix extra underscores in case rules (L010 and L014) #1396
Conversation
See also this comment where some of these rules were decided: #820 (comment) |
FYI: @panasenco |
I agree with most of your comments, barring one. #820 (comment) |
We've discussed on that thread and explained my reasoning, and think we've agreed now on what's been implemented here. So all good to review. But thanks for looking and challenging! Always good to hear opinions and thrash things out to make sure what's being proposed is correct. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks reasonable to me, but I'm not the most qualified person for the casing stuff. Think we should tag the original author of this work? IIRC, it was contributed about 4 months ago, so they may still be available.
See the comment two above this 😁 There was a robust conversation with @WittierDinosaur on this in that other thread and I eventually managed to persuade him round to what we have here. Will give it a day or two to see if any more comments and, if not, merge. |
@tunetheweb: Ah yes, I see some of the earlier discussion now. I'm 👍 for not adding/removing underscores due to the danger of breaking previously working code. I'll throw out there, one option that I don't think y'all considered would be to warn about non-complying code but not provide automatic fixes if it would involve adding/removing underscores or something dangerous like that. No strong feelings about whether to do this. Possibly a future option depending on other reviewers' thoughts and/or the eventual user feedback. |
Codecov Report
@@ Coverage Diff @@
## main #1396 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 127 127
Lines 8553 8550 -3
=========================================
- Hits 8553 8550 -3
Continue to review full report at Codecov.
|
Brief summary of the change made
Fixes #1394
Are there any other side effects of this change that we should be aware of?
Currently the rules were setting Pascal capitalisation policy to be an alternative to underscores, and so adding and removing underscores when fixing case issues.
ThisIsAnExample
(pascal case) ->this_is_an_example
(lowercase)this_is_an_example
(lowercase) ->ThisIsAnExample
(pascal case)This is not my understanding of Pascal Case should be converted, and is more like Snake Case.
With this PR, we now leave underscores alone.
The rules were also lowercasing Capital letters in the middle or words which is, again, not my understanding of PascalCase (as it's name suggests!)
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 intest/fixtures/rules/std_rule_cases
..sql
/.yml
parser test cases intest/fixtures/parser
(note YML files can be auto generated withpython test/generate_parse_fixture_yml.py
or by runningtox
locally).test/fixtures/linter/autofix
.Added appropriate documentation for the change.
Created GitHub issues for any relevant followup/future enhancements if appropriate.