skillfed

flake8-bugbear

A plugin for flake8 finding likely bugs and design problems in your program. Contains warnings that don't belong in pyflakes and pycodestyle.

flake8-bugbear v25.11.29 5.0M downloads/30d#2,177 on PyPI1,115
Permissive license MIT Active released

What it is and what it does

flake8-bugbear is a flake8 plugin that extends Python linting with opinionated checks for bugs and design antipatterns. It fills a gap between the core linters (pyflakes and pycodestyle) and more comprehensive tools by focusing on patterns that are genuinely problematic but too specific or debatable for the main Python tooling. The plugin runs automatically once installed and integrated with flake8, adding warnings like B001 (bare except clauses), B006 (mutable default arguments), B008 (function calls in defaults), and many others that catch real mistakes developers commonly make.

The package depends on flake8 and attrs, both widely used and stable. It supports current Python versions (3.10 through 3.14) and has been actively maintained since 2016. With no known security vulnerabilities and a permissive MIT license, it is designed to be deployed flexibly across different projects and environments. The plugin's opinionated nature is intentional—rules live here precisely because they do not belong in standardized tools, giving teams the choice to adopt them or not.

Use it for:

  • Catch bare except clauses and other exception-handling mistakes that can mask serious bugs.
  • Detect mutable default arguments and function calls in defaults that cause subtle state-sharing bugs.
  • Flag redundant exception types in except blocks and other code patterns that waste CPU or cause confusion.
  • Identify loop control variables that override iterables or are unused, catching common loop mistakes.
  • Enforce better practices in abstract base classes and context managers.
  • Integrate into CI/CD pipelines to enforce consistent code quality standards across a team.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

A flake8 plugin that detects likely bugs and design problems in Python code through opinionated linting rules not covered by pyflakes or pycodestyle.

Yes. flake8-bugbear is worth installing if you use flake8 and want to catch real bugs and design problems that the standard linters miss. It has low install friction, active maintenance, no security issues, and a permissive license. The only caveat is that its rules are opinionated—review the warning list to confirm they align with your team's coding standards before adopting it widely.

Install

flake8-bugbear on PyPI

pip

pip install flake8-bugbear

uv

uv add flake8-bugbear

poetry

poetry add flake8-bugbear

Installing flake8-bugbear

Before you install

Installs with minimal friction—a pure-Python wheel with only flake8 and attrs as runtime dependencies. Actively maintained with a recent release and steady commit activity.

License in practice

MIT license permits unrestricted use, modification, and distribution in both open and proprietary projects with only attribution required.

Quickstart

pip install flake8-bugbear

flake8 your_code.py

# Automatically integrated into flake8; check detection with:
flake8 --version

Requires Python 3.10 or later and flake8 to be installed.

Verify before relying

  • Specific count and scope of all warning rules beyond the B001–B027 examples shown in the description excerpt.
  • Performance impact on large codebases or CI/CD pipelines.
  • Configurability and rule-suppression mechanisms beyond standard flake8 configuration.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 2 — flake8, attrs
Maintenance actively maintained — 258 days since the last release
Last repo commit
First released
Downloads 5,041,661/month — #2,177 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: flake8_bugbear-25.11.29-py3-none-any.whl

Keywords: flake8, bugbear, bugs, pyflakes, pylint, linter, qa

Development Status :: 5 - Production/StableEnvironment :: ConsoleFramework :: Flake8Intended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Software Development :: Libraries :: Python ModulesTopic :: Software Development :: Quality Assurance

Tags

flake8 plugin for bug detectionpython linter for common mistakescode quality checks for design problemsflake8 bugbear warningspython static analysis pluginlinting tool for python bugscode smell detector
lintingstatic-analysiscode-quality

More Python Modules packages