New pycodestyle.max-line-length option#8039
Merged
MichaReiser merged 2 commits intomainfrom Oct 24, 2023
Merged
Conversation
This was referenced Oct 18, 2023
Merged
Member
Author
|
Current dependencies on/for this PR:
This comment was auto-generated by Graphite. |
charliermarsh
approved these changes
Oct 18, 2023
Member
charliermarsh
left a comment
There was a problem hiding this comment.
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
Member
Author
Thanks, that's helpful input. It wasn't clear to me what the initial intent was. |
3be7279 to
3fb2088
Compare
cdf59e9 to
306e876
Compare
Contributor
306e876 to
710f0a3
Compare
charliermarsh
approved these changes
Oct 19, 2023
710f0a3 to
5ce77dd
Compare
3fb2088 to
596a8ad
Compare
5ce77dd to
ef66597
Compare
dhruvmanila
approved these changes
Oct 20, 2023
596a8ad to
bcfb73b
Compare
ef66597 to
56a3cfa
Compare
pycodestyle.max-line-width optionpycodestyle.max-line-length option
56a3cfa to
1ebf1c3
Compare
charliermarsh
approved these changes
Oct 24, 2023
1c1aed4 to
de85ade
Compare
1ebf1c3 to
baf1605
Compare
Member
Author
Merge activity
|
baf1605 to
6267221
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
This PR introduces a new
pycodestyl.max-line-lengthoption that allows overriding the globalline-lengthoption forE501only.This is useful when using the formatter and
E501together, where the formatter uses a lower limit andE501is 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-widthorline-widthoption to make that decision.I opted for the global
line-widthfor 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-widthbecause 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-widthorline-widthto decide on whether to emit a fix or not.Edit: The linter users
pycodestyle.max-line-width. Theline-widthoption has been removed from theLinterSettingsTest Plan
Added integration test. Built the documentation and verified that the links are correct.