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 flake8 to pre-commit checks, with local bugbear as a plug-in #425

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .flake8-pre-commit.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Additional flake8 config which allows the pre-commit flake8 installation to
# use our local plugin as-is.
[flake8:local-plugins]
extension =
MC1 = bugbear:BugBearChecker
paths =
.
8 changes: 8 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,11 @@ repos:
- id: black
args:
- --preview

- repo: https://github.com/pycqa/flake8
rev: 6.1.0
Copy link
Collaborator

Choose a reason for hiding this comment

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

What does this rev refer to? Our latest tag / release is 23.9.16

If we can not use it cause re remove it or make it 99.0.0 or something + comment why we've done so

hooks:
- id: flake8
args: [--append-config=.flake8-pre-commit.cfg]
additional_dependencies: [attrs>=19.2.0]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why don't we need flake8 here? Can't our pyproject.toml handle this to avoid copy pasta / more things to change in the future?

exclude: ^tests\/
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just so I understand, this is so we don't hit the test code that htis our checks on purpose right?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Just so I understand, this is so we don't hit the test code that htis our checks on purpose right?