skillfed

yesqa

Automatically remove unnecessary `# noqa` comments.

yesqa v1.5.0 132.4K downloads/30d#11,554 on PyPI264
Permissive license MIT Active released

What it is and what it does

yesqa is a maintenance tool that scans Python code for `# noqa` comments and removes those that are no longer needed. It integrates with flake8 to determine which suppressions are actually suppressing violations; if a comment no longer matches any active violation, it gets removed. This is useful when your linting configuration changes (e.g., you increase max line length), when code is refactored and violations disappear, or when noqa comments were added by mistake.

The tool works as a standalone command-line utility or as a pre-commit hook, making it easy to enforce clean suppression comments across a team or CI pipeline. It depends on flake8 for violation detection and tokenize-rt for safe comment manipulation, and supports both CPython and PyPy on modern Python versions.

Use it for:

  • Clean up noqa comments after raising your flake8 line-length limit or disabling certain checks.
  • Remove stale suppressions when refactoring code that previously violated linting rules.
  • Enforce hygiene in pre-commit hooks to prevent accumulation of dead noqa comments over time.
  • Audit a codebase to find noqa comments that were added by mistake and no longer serve a purpose.
  • Integrate into CI to automatically flag or remove unnecessary suppressions during code review.

Worth the install?

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

yesqa automatically removes unnecessary `# noqa` comments from Python code, detecting and cleaning up suppressions that no longer apply due to configuration changes, code modifications, or mistakes.

Yes. yesqa solves a real maintenance problem—noqa comment drift—with low install friction, active maintenance, permissive licensing, and no known vulnerabilities. It's most valuable in teams or projects that use flake8 and want to keep suppression comments honest over time.

Install

yesqa on PyPI

pip

pip install yesqa

uv

uv add yesqa

poetry

poetry add yesqa

Installing yesqa

Before you install

Low friction: pure Python wheel with only two runtime dependencies (flake8 and tokenize-rt). Actively maintained as of July 2026 with consistent commit history.

License in practice

MIT license (permissive) places no restrictions on use, modification, or distribution in commercial or private projects.

Quickstart

pip install yesqa

# Run on a Python file
yesqa your_file.py

# Or use as a pre-commit hook by adding to .pre-commit-config.yaml:
# - repo: https://github.com/asottile/yesqa
#   rev: v1.5.0
#   hooks:
#   - id: yesqa

Requires Python 3.8 or later; flake8 must be installed (included as a runtime dependency).

Verify before relying

  • Whether yesqa correctly handles all flake8 plugin combinations when additional_dependencies are specified.
  • Performance characteristics on very large codebases or projects with many noqa comments.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.8)
Install friction low — pure-Python wheel
Runtime dependencies 2 — flake8, tokenize-rt
Maintenance actively maintained — 1,161 days since the last release
Last repo commit
First released
Downloads 132,383/month — #11,554 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: yesqa-1.5.0-py2.py3-none-any.whl

License :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPy

Tags

remove unnecessary noqa commentsclean up flake8 suppressionsautomate noqa comment removalflake8 noqa cleanupunused noqa comment detectioncode quality automationlinter comment maintenance
lintingcode-qualitypre-commit

More Quality Assurance packages