--- id: flake8-noqa version: "1.5.0" license: GNU Lesser General Public License v3 license_treatment: copyleft maintenance: aging --- # flake8-noqa — Flake8 noqa comment validation License: copyleft · Maintenance: aging · Downloads: 1.4M/mo ## What it is and what it does flake8-noqa is a flake8 plugin that enforces correct formatting of `# noqa` comments and detects when they are unnecessary or malformed. It catches subtle mistakes like missing colons, extra spaces, or duplicate codes that would cause flake8 to misinterpret a targeted suppression as a blanket one—potentially hiding errors you care about. The plugin reports errors via codes like NQA001–NQA004 for formatting issues, NQA101–NQA104 for unnecessary or unmatched suppressions, and NQA011–NQA013 for the `# flake8: noqa` variant. The plugin integrates directly into flake8's linting pipeline and requires no separate configuration to activate. It supports optional modes to enforce that all noqa comments include error codes, and can optionally include the plugin name in error messages. The description notes that some flake8 plugins intercept noqa comments before flake8 sees them, which can cause false positives; in such cases, the offending plugin should be configured to let flake8 handle noqa logic. Use it for: - Catch typos in noqa comments (missing colons, wrong spacing) that would silently become blanket suppressions and hide real errors. - Enforce a team standard that all noqa comments must include specific error codes rather than blanket suppressions. - Identify and remove unnecessary noqa comments that target violations no longer present in the codebase. - Detect duplicate error codes within a single noqa comment and flag them for cleanup. - Validate that noqa comments actually match violations flake8 has detected on that line. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. A flake8 plugin that validates the formatting and necessity of `# noqa` comments in Python code, catching malformed comments that would be silently ignored and flagging unnecessary suppressions. Yes, if you use flake8 and want to prevent silent noqa comment failures. The plugin is lightweight, has no surprising dependencies, and solves a real problem: malformed noqa comments are easy to write and hard to spot. Maintenance is aging but the repository is active. The copyleft license is a consideration for proprietary projects. No known vulnerabilities. ## Install pip install flake8-noqa uv add flake8-noqa poetry add flake8-noqa ## Installing flake8-noqa Before you install: Low friction: pure Python wheel with only flake8 and typing_extensions as runtime dependencies. Maintenance is aging (188 days since last release), but the repository is active and not archived. License in practice: Licensed under GNU Lesser General Public License v3 (copyleft). Derivative works and modifications must be distributed under the same or compatible license; proprietary code using this plugin should review copyleft obligations. Quickstart: pip install flake8-noqa # Then run flake8 as normal; the plugin activates automatically flake8 your_file.py # Optional: enable code requirement in config or CLI flake8 --noqa-require-code your_file.py Requires Python 3.9 or later and flake8 to be installed and configured in your project. Verify before relying: - Whether the plugin's error codes (NQA001–NQA104) can be suppressed via flake8's standard ignore mechanisms without creating circular logic. - Compatibility with flake8 plugins that process noqa comments themselves (the description notes this as a known anti-pattern but doesn't enumerate which plugins are affected). ## Package facts - License: GNU Lesser General Public License v3 (copyleft) - Python support: supports_current - Install friction: low - Maintenance: aging - Downloads: 1.4M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags flake8 noqa comment validation, noqa comment formatter, flake8 plugin quality check, validate noqa syntax, detect unused noqa comments, flake8 comment linter, flake8-plugin, code-quality [View on SkillFed](https://skillfed.io/packages/flake8-noqa) · [View on PyPI](https://pypi.org/project/flake8-noqa/)