-
-
Notifications
You must be signed in to change notification settings - Fork 651
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
Issue 845: L016 should compute line length prior to template expansion #1411
Issue 845: L016 should compute line length prior to template expansion #1411
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1411 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 127 127
Lines 8553 8580 +27
=========================================
+ Hits 8553 8580 +27
Continue to review full report at Codecov.
|
{{corr_states}} | ||
{% for action in considered_actions %} | ||
, aaa( | ||
bbb(ccc({{metric}}_r, {{action}}), ddd({{metric}}_r)), |
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.
This test specifies max_line_length
= 50, but this line was 67 characters long. The new result looks correct to me.
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.
A reverse case of what you are trying to fix here!
Post templating this is 47-48 characters long as the template values where shorter than the template place holders.
So I agree it's correct that it now splits it with your code change as it's now looking at the placeholder lengths.
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.
Exactly. The previous behavior was incorrect, and often very confusing from a user perspective.
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.
LGTM. A few comments for you to consider.
Fixes #845
...
Are there any other side effects of this change that we should be aware of?
...
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.