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

fix: line-length checks are now a bit more tolerant using Bugbear only #410

Merged
merged 1 commit into from
Dec 21, 2022

Conversation

jenstroeger
Copy link
Owner

Both pylint’s line-too-long check and flake8’s E501 are hard limits—one character over the configured line limit (120 characters in our case) triggers the error.

Bugbear’s B950 is more flexible in that…

This is a pragmatic equivalent of pycodestyle's E501: it considers "max-line-length" but only triggers when the value has been exceeded by more than 10%. You will no longer be forced to reformat code due to the closing parenthesis being one character too far to satisfy the linter. At the same time, if you do significantly violate the line length, you will receive a message that states what the actual limit is. This is inspired by Raymond Hettinger's "Beyond PEP 8" talk and highway patrol not stopping you if you drive < 5mph too fast. Disable E501 to avoid duplicate warnings.

This change disables both pylint’s and flake8’s line checks and uses Bugbear’s only.

@jenstroeger jenstroeger requested a review from behnazh December 4, 2022 01:48
@jenstroeger jenstroeger force-pushed the improve-line-length-checks branch from 2e8adfc to 700959f Compare December 19, 2022 13:33
@jenstroeger jenstroeger merged commit c267ba3 into staging Dec 21, 2022
@jenstroeger jenstroeger deleted the improve-line-length-checks branch January 22, 2023 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants