Skip to content

Introduce flake8 bugbear plugin #1101

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

Merged
merged 2 commits into from
Nov 8, 2022
Merged

Conversation

sliverc
Copy link
Member

@sliverc sliverc commented Nov 8, 2022

Description of the Change

Bugbear is a plugin for flake8 finding likely bugs and design problems. This PR adds it to DJA and already found some potential issues.

Also, it introduces an optional “line length too long” error which is more pragmatic than the E507 which we had disabled.
Currently, we disable line length altogether and leave it up to black to make it shorter. However, black does not format strings and comments etc. so some lines end up being very long. Bugbear will only flag lines which are longer than ~10% of the maximum length to solve this problem, but not to make the error becoming annoying.

Checklist

  • PR only contains one change (considered splitting up PR)
  • unit-test added
  • documentation updated
  • CHANGELOG.md updated (only for user relevant changes)
  • author name in AUTHORS

@sliverc sliverc requested a review from n2ygk November 8, 2022 20:10
Copy link
Contributor

@n2ygk n2ygk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comment question but not worth holding back merging for.

@n2ygk n2ygk merged commit 9ced3be into django-json-api:main Nov 8, 2022
@sliverc sliverc deleted the bugbear branch November 9, 2022 03:30
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