-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
New pycodestyle.max-line-length
option
#8039
Conversation
Current dependencies on/for this PR:
This comment was auto-generated by Graphite. |
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.
I think any of:
- Global line width
- pycodestyle line width
- Explicit take the min(global line width, pycodestyle line width)
...would all be reasonable choices, so I'm fine to approve with any of those, but if I had to choose, I would say that using the pycodestyle line width is probably the most consistent with the intent, since the intent was to avoid introducing E501 violations.
90760b0
to
3be7279
Compare
00fe68e
to
385690c
Compare
Thanks, that's helpful input. It wasn't clear to me what the initial intent was. |
3be7279
to
3fb2088
Compare
cdf59e9
to
306e876
Compare
306e876
to
710f0a3
Compare
710f0a3
to
5ce77dd
Compare
3fb2088
to
596a8ad
Compare
5ce77dd
to
ef66597
Compare
596a8ad
to
bcfb73b
Compare
ef66597
to
56a3cfa
Compare
pycodestyle.max-line-width
optionpycodestyle.max-line-length
option
56a3cfa
to
1ebf1c3
Compare
1c1aed4
to
de85ade
Compare
1ebf1c3
to
baf1605
Compare
Merge activity
|
baf1605
to
6267221
Compare
Summary
This PR introduces a new
pycodestyl.max-line-length
option that allows overriding the globalline-length
option forE501
only.This is useful when using the formatter and
E501
together, where the formatter uses a lower limit andE501
is only used to catch extra-long lines.Closes #7644
Considerations
Our fix infrastructure asserts in some places that the fix doesn't exceed the configuredline-width
. With this change, the question is whether it should use thepycodestyle.max-line-width
orline-width
option to make that decision.I opted for the global
line-width
for now, considering that it should be the lower limit. However, this constraint isn't enforced and users not using the formatter may only specifypycodestyle.max-line-width
because they're unaware of the global option (and it solves their need).I'm interested to hear your thoughts on whether we should usepycodestyle.max-line-width
orline-width
to decide on whether to emit a fix or not.Edit: The linter users
pycodestyle.max-line-width
. Theline-width
option has been removed from theLinterSettings
Test Plan
Added integration test. Built the documentation and verified that the links are correct.