-
-
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
Add rule names to CLI outputs #4400
Conversation
Pull Request Test Coverage Report for Build 4222244003
💛 - Coveralls |
Codecov ReportBase: 100.00% // Head: 100.00% // No change to project coverage 👍
Additional details and impacted files@@ Coverage Diff @@
## main #4400 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 201 201
Lines 15409 15451 +42
=========================================
+ Hits 15409 15451 +42
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. |
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.
We're getting so close! Great work 👏🏻👏🏻
This sets completes the CLI elements of #4031. It builds on the work done in #4399 (and I'm assuming we'll agree and merge that before moving on to this). I'll keep this PR in draft until that one is done, but I thought I'd open in early so people can feedback on the output (and also so I can make sure that tests pass 😺 ).
Specifically this PR adds out two CLI improvements to support named rules. To allow testing of those, it adds names, groups, and aliases (in the form of their future new code for now) - although I anticipate that we will do the actual recoding as a final separate PR.
sqlfluff rules
Firstly this adds names, groups and aliases (where present) to the
sqlfluff rules
command. The new output looks like this:NOTE: The codes are still the existing codes rather than the proposed codes (as I've said above), but see that the new proposed codes are currently in as aliases.
This makes the CLI output much more verbose, but I thought it a good idea to be explicit on names, codes, groups and aliases in this CLI command to promote their use.
linting output
Secondly it adds the rule name to the linting output. The new output looks like this:
NOTE: I haven't added a name for L065 yet (so it shows no name - and that would also be true for a rule plugin which doesn't yet define a name), and for L001 there is a name, but it's only on a new line because there isn't space on the existing line. If there is space, then it should be on the same line.
Rather than trying to build the name into a table format as suggested in the original issue, this simply add the rule name to the end of the output which is closer to the pylint format. The main reason for that is that the current output conforms to an 80 character line width limit. If we try and fit another column within that 80 char limit there really isn't much space left for the description itself.