Skip to content
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 pydocstyle.line-width option #7644

Closed
Tracked by #7642
MichaReiser opened this issue Sep 25, 2023 · 0 comments · Fixed by #8039
Closed
Tracked by #7642

Add pydocstyle.line-width option #7644

MichaReiser opened this issue Sep 25, 2023 · 0 comments · Fixed by #8039
Assignees
Labels
configuration Related to settings and configuration

Comments

@MichaReiser
Copy link
Member

Add a new pydocstyle.line-width option that overrides the default line-width setting. This allows using the formatter with E501 where E501 uses another configured line-length.

Considered alternatives: Creating a new option specific to pycodestyle rather than a formatter-specific option feels more intuitive because the override is specific to this lint rule and then aligns with pydocstyle.max-doc-length.

@MichaReiser MichaReiser added the configuration Related to settings and configuration label Sep 25, 2023
@MichaReiser MichaReiser added this to the Formatter: Beta milestone Sep 25, 2023
@MichaReiser MichaReiser self-assigned this Oct 19, 2023
MichaReiser added a commit that referenced this issue Oct 24, 2023
## Summary

This PR introduces a new `pycodestyl.max-line-length` option that allows overriding the global `line-length` option for `E501` only.

This is useful when using the formatter and `E501` together, where the formatter uses a lower limit and `E501` 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 configured `line-width`. With this change, the question is whether it should use the `pycodestyle.max-line-width` or `line-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 specify `pycodestyle.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 use `pycodestyle.max-line-width` or `line-width` to decide on whether to emit a fix or not.~~

Edit: The linter users `pycodestyle.max-line-width`. The `line-width` option has been removed from the `LinterSettings`

## Test Plan

Added integration test. Built the documentation and verified that the links are correct.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
configuration Related to settings and configuration
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant