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

Support Pascal case for L030 #2739

Merged
merged 1 commit into from Feb 28, 2022
Merged

Conversation

tunetheweb
Copy link
Member

Brief summary of the change made

Fixes #2736

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

This is a breaking change as L030 goes from using capitalisation_policy to extended_capitalisation_policy so anyone using it will need to change their config. Should be a 0.11.0 release.

Unfortunately it's not possible to support both for backwards compatibility.

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.

@tunetheweb tunetheweb mentioned this pull request Feb 28, 2022
3 tasks
@codecov
Copy link

codecov bot commented Feb 28, 2022

Codecov Report

Merging #2739 (19f3e8f) into main (a1571ac) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##              main     #2739   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          163       163           
  Lines        12094     12095    +1     
=========================================
+ Hits         12094     12095    +1     
Impacted Files Coverage Δ
src/sqlfluff/rules/L030.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a1571ac...19f3e8f. Read the comment docs.

@tunetheweb
Copy link
Member Author

Calling out this point form PR template:

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

This is a breaking change as L030 goes from using capitalisation_policy to extended_capitalisation_policy so anyone using it will need to change their config. Should be a 0.11.0 release.

Unfortunately it's not possible to support both for backwards compatibility.

I still think it's a good change though as Function names are more likely to want PascalCase.

Only thing is it doesn't support lower pascal case (e.g. functionName instead of FunctionName) which may be wanted by some. Might want to consider adding that in future.

Comment on lines -47 to +49
test_fail_fully_qualified_function_mixed_case:
fail_str: SELECT project1.FoO(value1) AS value2
fix_str: SELECT project1.FOO(value1) AS value2
test_pass_fully_qualified_function_pascal_case:
pass_str: SELECT project1.FoO(value1) AS value2
Copy link
Member Author

Choose a reason for hiding this comment

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

This test went from failing (when pascalcase wasn't one of the default consistent options) to passing (now it is).

@tunetheweb tunetheweb merged commit db7bd41 into sqlfluff:main Feb 28, 2022
@tunetheweb tunetheweb deleted the l030-pascal-case branch June 23, 2022 10:17
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.

Support Pascal Case for L030
2 participants