-
-
Notifications
You must be signed in to change notification settings - Fork 653
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
Allow L059 to be configured to always prefer quoted identifiers #2537
Conversation
Extend L059 to allow user-defined configuration to set if the identifiers must be always quoted or preferably unquoted, and when quotes are necessary or wanted, which one to use.
Add new configurations for L059
Manage user-defined configuration to allow to force quoted identifiers, and prefer some quotes over others. See sqlfluff#2527
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.
Very good work! However I do have quite a few comments and fear this won't work for some dialects as is.
Co-authored-by: Barry Pollard <barry_pollard@hotmail.com>
Co-authored-by: Barry Pollard <barry_pollard@hotmail.com>
Co-authored-by: Barry Pollard <barry_pollard@hotmail.com>
Co-authored-by: Barry Pollard <barry_pollard@hotmail.com>
@tunetheweb Thanks a lot for your participation |
Remove attempt to manage the type of quote to be used for quoted_identifiers.
Fix tests as default dialect is ansi and backticks are not parsed. Added bigquery dialect tests to ensure this is working also with backticks when dialect is supporting them.
Codecov Report
@@ Coverage Diff @@
## main #2537 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 163 163
Lines 11758 11768 +10
=========================================
+ Hits 11758 11768 +10
Continue to review full report at Codecov.
|
Co-authored-by: Barry Pollard <barry_pollard@hotmail.com>
Co-authored-by: Barry Pollard <barry_pollard@hotmail.com>
Co-authored-by: Barry Pollard <barry_pollard@hotmail.com>
Co-authored-by: Barry Pollard <barry_pollard@hotmail.com>
Co-authored-by: Barry Pollard <barry_pollard@hotmail.com>
Co-authored-by: Barry Pollard <barry_pollard@hotmail.com>
Co-authored-by: Barry Pollard <barry_pollard@hotmail.com>
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.
Pretty much there. One suggestion that I'll commit and then merge.
Thanks for working on this @niconoe- ! And for being patient with all the feedback. |
Brief summary of the change made
fixes #2527 by providing a configuration option on the L059 rule.
Are there any other side effects of this change that we should be aware of?
No side effects expected as the default values for the newly added configuration are respecting the previous L059 behavior.
Pull Request checklist
.yml
rule test cases intest/fixtures/rules/std_rule_cases
.Even though I think I have fulfilled the requirements in terms of development, tests, documentation, please do not hesitate to help me ensuring this PR is OK, as I didn't wrote anything in python since a decade (literally), and I'm not 100% sure I respected the code of conduct (and if I failed, I'm sorry, I'll fix my mistakes).