Skip to content

Update dependency flake8-bugbear to v26 - #94

Open
renovate[bot] wants to merge 1 commit into
masterfrom
renovate/flake8-bugbear-26.x
Open

renovate[bot] wants to merge 1 commit into
masterfrom
renovate/flake8-bugbear-26.x

Conversation

@renovate

@renovate renovate Bot commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Change Age Confidence
flake8-bugbear (changelog) ==21.11.29 → ==26.11.16 age confidence

Release Notes

PyCQA/flake8-bugbear (flake8-bugbear)

v26.11.16

Compare Source

  • B048: Add new check for using the result of str.find()/str.rfind() directly as a boolean (#​170)
  • B909: detect mutations when a loop unpacks the iterable's elements.
  • B040: don't report an exception whose note is shown by logger.exception(),
    exc_info=True, traceback.print_exc()/format_exc() or sys.exc_info()
  • B021: also check f-string docstrings on async def functions
  • README: add Avoid/Prefer code examples for B006, B008, B015, B017, B023 and B032

v26.11.9

Compare Source

  • Drop Python 3.10 support (flake8 itself now requires >=3.11)
  • B018: only report a map(), filter(), reversed(), zip() or
    enumerate() statement when the name is the builtin, not when the module
    defines or imports its own function under that name, which may well do the work
  • B031, B911: a bare groupby/batched imported from itertools no longer
    counts as itertools when a later module-level def or assignment replaces it
  • B031, B911: an annotated batched: Callable = itertools.batched counts as
    itertools, like the same assignment without the annotation
  • B912, B913: only report map() and zip() when the name is the builtin, not
    when a module-level def, class, import or assignment replaces it with
    something else
  • B905, B910: only report zip() and defaultdict(int) when the name is the
    builtin zip/collections.defaultdict, not when a module-level def,
    class, import or assignment replaces it with something else
  • B018, B031, B905, B910, B911: an import or zip = builtins.zip style alias
    inside a function or class no longer overrides the module's own def,
    class or import of that name, since it only binds the name locally
  • B042: don't report an __init__ that calls a direct base class's __init__
    explicitly and forwards its own arguments unchanged and in order, like
    Exception.__init__(self, msg, opt), also after another base's __init__
    such as a mixin's
  • Add type hints throughout bugbear, checked with mypy --strict in tox and CI

v26.10.27

Compare Source


* B007: don't flag a loop variable that is read by a function or lambda defined
  in the same scope as the loop (#​175)
* B049: New check for ``@abstractmethod`` listed before ``@property``,
  ``@classmethod`` or ``@staticmethod`` (or a property ``.setter``/``.getter``/
  ``.deleter``). It must be the innermost decorator, otherwise the class definition
  raises ``AttributeError`` (#​279)
* B906: don't flag ``visit_`` methods of libcst visitors (classes inheriting
  from ``libcst``), which have no ``generic_visit`` (#​359)
* B045: detect reuse of an enclosing loop's control variable in a nested loop
  in the same scope (#​360).
* B046: New check for ``dict.fromkeys()`` called with a mutable value, which is
  shared by every key (#​387)
* B005: say in the message that only strings with repeated characters are
  reported, since ``.strip("abc")`` style character sets are fine (#​91)
* B047: New check for ``except`` handlers that can never run because an earlier
  handler already catches a builtin parent exception (#​349)
* B044: also report asserts on other always-true values, such as a message
  without a condition (``assert "x must be positive"``), non-zero numbers,
  f-strings with literal text, non-empty list/set/dict literals and lambdas
  (#​534, #​440)
* B031: only treat a bare ``groupby()`` call as ``itertools.groupby`` when the
  module doesn't bind ``groupby`` to something else, such as its own
  ``def groupby`` (#​356)
* B025: fix the message running ``except`` and the exception name together
  (``exceptValueError``) and dropping the ``*`` for ``except*`` handlers
* B903: don't flag classes that inherit from another class, like an exception
  or ``dict`` subclass, which a namedtuple can't replace, and fix ``__slot__``
  in the message to ``__slots__`` (#​63)
* B950: respect the ``max-doc-length`` option for docstring and comment-only lines,
  as ``pycodestyle``'s ``W505`` does; behavior is unchanged when it is not set (#​285)
* B902: treat ``abc.abstractclassmethod`` and ``abc.abstractstaticmethod`` like
  ``classmethod`` and ``staticmethod`` instead of expecting ``self`` (#​33)
* B909: also check loops over ``d.keys()``, ``d.values()`` and ``d.items()``,
  which are views of ``d``, so ``for k in d.keys(): d.pop(k)`` is reported like
  ``for k in d: d.pop(k)``
* B012: don't flag ``break`` or ``continue`` in an ``async for`` loop inside a
  ``finally`` block, as for ``for`` and ``while`` loops
* B018: also report generator expressions and lambdas used as statements. A
  statement like ``(print(x) for x in items)`` never runs its body, and a bare
  ``lambda x: True`` is usually an assignment that lost its target (#​452)
* B018: also report ``map()``, ``filter()``, ``reversed()``, ``zip()`` and
  ``enumerate()`` calls used as statements. They return lazy iterators, so
  ``map(print, items)`` on its own line never calls ``print`` (#​452)
* B909: also check mutations in ``if`` conditions and ``elif``/``else``
  branches inside loops (#​606)
* B042: don't treat a class named like an exception as one when its only base is
  ``object``, as in ``class ParsedException(object)`` (#​538)
* B911: only treat a bare ``batched()`` call as ``itertools.batched`` when the
  module doesn't bind ``batched`` to something else, such as its own
  ``def batched``, the same way B031 handles ``groupby()``

v26.9.30

Compare Source

  • B008: resolve direct module-level imports and aliases when matching extend-immutable-calls (#​252)
  • B015: allow comparisons inside pytest/unittest exception and warning assertion context managers, where an overloaded comparison may intentionally raise (#​462).
  • B020: stop flagging names bound inside nested destructuring patterns, like series in for i, (ax, (series, name)) in enumerate(zip(axs, series)); the loop rebinds the top-level targets, not those names (#​521)
  • Add Python 3.15 support / CI
  • B913: fix crash on {**d for d in ...} dict unpacking in comprehensions, new in Python 3.15; B035 no longer mistakes the unpacked expression for a static key
  • B018: also report unary and arithmetic operations used as statements, such as a +c * d continuation line that lost its parentheses (#​452)
  • B042: don't treat a class named like an exception as one when its only bases are parameterized generics such as ContextManager[T]; a generic base named like an exception, such as MyError[int], now counts (#​538)

v26.9.9

Compare Source

  • B044: New check for assert <generator_expression>, which is always true (#​534)
  • B031: allow reusing a group after assigning list(group) or tuple(group) back to the same name (#​395)
  • B028: report warnings.warn calls that pass an explicitly empty skip_file_prefixes tuple (#​510)
  • B019: also flag async_lru.alru_cache and check cache decorators on async def methods (#​488)
  • B023: don't flag a function whose every reference is a direct call inside the loop body (#​468, #​380)
  • B020: don't flag for self.a in self.b: rebinding an attribute is not rebinding the base name (#​248)
  • B018: handle also useless calls such as isinstance(x, int) without assigning or using the result
  • B031: don't count a store-context reference as a use of the groupby generator, and don't treat references in mutually exclusive if/elif/else branches as multiple uses (#​465)
  • B902: don't raise a false positive on a metaclass defined with a dotted base such as abc.ABCMeta or enum.EnumMeta (#​411)
  • B913: Add an optional check for unused _ targets in zip() loops (#​545)
  • B912: only emit on Python 3.14+ where map() supports strict= (#​548)

v25.11.29

Compare Source

  • B043: Add new check to state don't call delattr with constant (#​514)
  • B042: ignore overloaded init, ignore if str+pickle dunder, improve README

v25.10.21

Compare Source

  • B042: New check for reminding to call super().init in custom exceptions
  • B028: Skip if skip_file_prefixes is used (#​503)
  • B912: New check for map() without an explicit strict= parameter. (#​516)
  • Add python3.14 Support / CI
  • Remove python3.9 support / CI
  • flake8-bugbear now requires at least Python 3.10, like the next release of flake8

v24.12.12

Compare Source

  • B012 and B025 now also handle try/except* (#​500)
  • Skip B028 if warnings.warn is called with *args or **kwargs (#​501)
  • Add B911: itertools.batched without strict= (#​502)
  • Readme has anchors per check (they do not seem to render on GitHub tho)

v24.10.31

Compare Source

  • B041: New dictionary same key AND value check (#​496)
  • B037: Fix typo in error message
  • B024: No longer treats assigned class variables as abstract (#​471)
  • Bump required attrs version to 22.2.0

v24.8.19

Compare Source

  • B910: implement to suggest using Counter() instead of defaultdict(int) (#​489)
  • B901: Do not trigger with explicit Generator return type (#​481)
  • B008: add some comments, rename b008_extend_immutable_calls (#​476)
  • B040: exception with note added not reraised or used (#​477)
  • B039, Add ContextVar with mutable literal or function call as default
  • B040: Add Exception with added note not reraised. (#​474)
  • Run tests in Python 3.13
  • Type annotated code (#​481 + #​483)
  • Replace hash with unsafe_hash (#​486)

v24.4.26

Compare Source

  • B909: Fix false positive affecting containers of mutables (#​469)

v24.4.21

Compare Source

  • B950: Add pragma comment to line length ignores (#​463)
  • B909: Add more cases to detect + more container mutating functions (#​460)

v24.2.6

Compare Source

  • B902: Remove decorators named validator and root_validator from B902 checks (#​459)
  • B038: Change B038 to B909 and make it optional (#​456)

v24.1.17

Compare Source

  • B038: Restrict rule to mutation functions only (#​453)

v24.1.16

Compare Source

  • B036: Fix crash on raise statements raising something other than

v24.1.15

Compare Source

  • B038: Add check for mutations of loop iterator (#​446)
  • B037: Add check for yielding or returning values in init() (#​442)
  • B017: make B017 also apply to BaseException (#​439)
  • B036: Add check for except BaseException without re-raising (#​438)

v23.12.2

Compare Source

  • B018: to detect useless-statements at all levels (#​434)
  • B018: Add classname to b018 useless-expression output (#​433)
  • B018: Include tuples in b018 useless-statement check (#​432)

v23.11.28

Compare Source

  • B035: Fix false positive when named expressions are used (#​430)

v23.11.26

Compare Source

  • B035: add check for static keys in dict-comprehension (#​426)
  • B902: Add exceptions for standard library metaclasses (#​415)
  • B017: Modify to no longer have a false negative when raises() is imported
    directly from pytest (#​424)
  • B026: Fix bug where the check was not triggered for calls where the caller
    is an attribute (#​420)

v23.9.16

Compare Source

  • add --classmethod-decorators (#​405)
  • fix name collision for node_stack on python 3.12 (#​406)
  • Use pypa/build to build the package (#​404)

v23.7.10

Compare Source

  • Add B034: re.sub/subn/split must pass flags/count/maxsplit as keyword arguments.
  • Fix a crash and several test failures on Python 3.12, all relating to the B907
    check.
  • Declare support for Python 3.12.

v23.6.5

Compare Source

  • Include tox.ini in MANIFEST.in for sdist. (#​389)
  • Improve B033 (duplicate set items) (#​385)

v23.5.9

Compare Source

  • Add B033: Detect duplicate items in sets
  • Add B908: Detect assertRauses like contexts only has top level statements that could throw
  • Add B028: Allow stacklevel to be explicitly assigned as a positional argument
  • Remove more < 3.8 checks / assertions

v23.3.23

Compare Source

  • flake8-bugbear is now >= 3.8.1 project like flake8>=6.0.0
    • This has allowed some more modern AST usage cleanup and less CI running etc.
  • B030: Fix crash on certain unusual except handlers (e.g. except a[0].b:)

v23.3.12

Compare Source

  • B950: now ignores 'noqa' and 'type: ignore' comments.
  • B005: Do not flag when using the strip() method on an imported module.
  • B030: Allow calls and starred expressions in except handlers.

v23.2.13

Compare Source

  • B906: Add visit_Bytes, visit_Num and visit_Str to the list of visit_*
    functions that are ignored by the B906 check. The ast.Bytes, ast.Num and
    ast.Str nodes are all deprecated, but may still be used by some codebases in
    order to maintain backwards compatibility with Python 3.7.
  • B016: Warn when raising f-strings.
  • Add B028: Check for an explicit stacklevel keyword argument on the warn method from the warnings module.
  • Add B029: Check when trying to use except with an empty tuple i.e. except: ().
  • Add B032: Check for possible unintentional type annotations instead of assignments.

v23.1.20

Compare Source

  • B024: now ignores classes without any methods. (#​336)
  • B017: Don't warn when pytest.raises() has a match argument. (#​334)
  • B906: Ignore visit_ functions with a _fields attribute that can't contain ast.AST subnodes. (#​330)

v23.1.17

Compare Source

  • Rename B028 to B907, making it optional/opinionated.

v23.1.14

Compare Source

  • Add B906: visit_ function with no further calls to a visit function. (#​313)
  • Add B028: Suggest !r when formatted value in f-string is surrounded by quotes. (#​319)

v22.12.6

Compare Source

  • Add B905: zip() without an explicit strict= parameter. (#​314)
  • B027: ignore @​overload when typing is imported with other names (#​309)

v22.10.27

Compare Source

  • B027: Ignore @​overload decorator (#​306)
  • B023: Also fix map (#​305)
  • B023: Avoid false alarms with filter, reduce, key= and return. Added tests for functools (#​303)

v22.10.25

Compare Source

  • Make B015 and B018 messages slightly more polite (#​298)
  • Add B027: Empty method in abstract base class with no abstract decorator
  • Multiple B024 false positive fixes
  • Move CI to use tox (#​294)
  • Move to using PEP621 / pyproject.toml package (#​291)
  • Tested in 3.11

v22.9.23

Compare Source

  • add B026: find argument unpacking after keyword argument (#​287)
  • Move to setup.cfg like flake8 (#​288)

v22.9.11

Compare Source

  • Add B025: Find duplicate except clauses (#​284)

v22.8.23

Compare Source

  • Add B024 error code to message for B024 (#​276)

v22.8.22

Compare Source

  • Add B024: abstract base class with no abstract methods (#​273)

v22.7.1

Compare Source

v22.6.22

Compare Source

  • Don't crash when select / extend_select are None (#​261)
  • Ignore lambda arguments for B020 (#​259)
  • Fix missing space typos in B021, B022 error messages (#​257)

v22.4.25

Compare Source

  • Ignore black formatting for b013 test case (#​251)
  • B010 Fix lambda false positive (#​246)
  • B008 Fix edge case with lambda functions (#​243)

v22.3.23

Compare Source

  • B006 and B008: Detect function calls at any level of the default expression (#​239)
  • B020: Fix comprehension false postives (#​238)
  • Tweak B019 desc (#​237)

v22.3.20

Compare Source

  • B022: No arguments passed to contextlib.suppress (#​231)
  • B021: f-string used as docstring. (#​230)
  • B020: ensure loop control variable doesn't overrides iterable it iterates (#​220)
  • B019: check to find cache decorators on class methods (#​218)
  • Fix crash on long empty string (#​223)

v22.1.11

Compare Source

  • B018: Ignore JoinedStr (#​216)
  • Build universal Python 3 wheels (#​214)
  • B950: Add same special cases as E501 (#​213)

Configuration

📅 Schedule: (UTC)

  • Branch creation
    • "before 1am on Saturday"
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate Bot added the renovate label Sep 12, 2026
@renovate
renovate Bot force-pushed the renovate/flake8-bugbear-26.x branch from 3c28ec4 to 1270e37 Compare October 1, 2026 05:25
@renovate
renovate Bot force-pushed the renovate/flake8-bugbear-26.x branch from 1270e37 to 7ad6c0a Compare October 27, 2026 22:02
@renovate
renovate Bot force-pushed the renovate/flake8-bugbear-26.x branch from 7ad6c0a to 3d131a8 Compare November 9, 2026 17:54
@renovate
renovate Bot force-pushed the renovate/flake8-bugbear-26.x branch from 3d131a8 to 2e000f1 Compare November 16, 2026 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants