--- id: yesqa version: "1.5.0" license: MIT license_treatment: permissive maintenance: active --- # yesqa — Automatically remove unnecessary `# noqa` comments. License: permissive · Maintenance: active · Downloads: 132.4K/mo ## 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 above — 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 pip install yesqa uv add yesqa 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_current - Install friction: low - Maintenance: active - Downloads: 132.4K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags remove unnecessary noqa comments, clean up flake8 suppressions, automate noqa comment removal, flake8 noqa cleanup, unused noqa comment detection, code quality automation, linter comment maintenance, linting, code-quality, pre-commit [View on SkillFed](https://skillfed.io/packages/yesqa) · [View on PyPI](https://pypi.org/project/yesqa/)