Merge ~cjwatson/launchpad:pre-commit-flake8-bugbear into launchpad:master

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: c249f4fc83782d9ff5f64ed27be661e7e140db04
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cjwatson/launchpad:pre-commit-flake8-bugbear
Merge into: launchpad:master
Diff against target: 33 lines (+11/-0)
2 files modified
.pre-commit-config.yaml (+1/-0)
setup.cfg (+10/-0)
Reviewer Review Type Date Requested Status
Jürgen Gmach Approve
Review via email: mp+454762@code.launchpad.net

Commit message

pre-commit: Enable flake8-bugbear

Description of the change

We haven't yet fixed all its default warnings, but most of them seem reasonable. Get this into our `pre-commit` checks so that we at least don't regress the ones we've fixed so far.

To post a comment you must log in.
Revision history for this message
Jürgen Gmach (jugmac00) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
2index 12369b7..7e7f119 100644
3--- a/.pre-commit-config.yaml
4+++ b/.pre-commit-config.yaml
5@@ -60,6 +60,7 @@ repos:
6 additional_dependencies:
7 - flake8-absolute-import==1.0.0.1
8 - flake8-alfred==1.1.1
9+ - flake8-bugbear==23.3.12
10 - repo: https://github.com/pre-commit/mirrors-eslint
11 rev: v8.33.0
12 hooks:
13diff --git a/setup.cfg b/setup.cfg
14index faaf10b..51645e8 100644
15--- a/setup.cfg
16+++ b/setup.cfg
17@@ -191,6 +191,16 @@ exclude =
18 # to Launchpad's style.
19 lib/contrib
20 ignore =
21+ # Temporarily ignore Bugbear checks that we haven't yet fixed everywhere.
22+ B004,
23+ B006,
24+ B008,
25+ B011,
26+ B015,
27+ B020,
28+ B023,
29+ B028,
30+ B031,
31 # Incompatible with Black.
32 E203,
33 # ==/!= comparisons with True/False/None are common idioms with Storm.

Subscribers

People subscribed via source and target branches

to status/vote changes: