https://github.com/asottile/yesqa
Automatically remove unnecessary `# noqa` comments
https://github.com/asottile/yesqa
flake8 pre-commit
Last synced: about 21 hours ago
JSON representation
Automatically remove unnecessary `# noqa` comments
- Host: GitHub
- URL: https://github.com/asottile/yesqa
- Owner: asottile
- License: mit
- Created: 2017-12-19T05:01:46.000Z (over 7 years ago)
- Default Branch: main
- Last Pushed: 2025-03-31T20:59:58.000Z (14 days ago)
- Last Synced: 2025-04-07T02:07:35.651Z (8 days ago)
- Topics: flake8, pre-commit
- Language: Python
- Size: 257 KB
- Stars: 266
- Watchers: 3
- Forks: 11
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-flake8-extensions - yesqa - A tool to automatically remove unnecessary `# noqa` comments. (Tools)
- awesome-python-ast - yesqa - A tool (and pre-commit hook) to automatically remove unnecessary # noqa comments (Other)
- awesome-codemods - **yesqa** - Remove unnecessary ``#noqa`` comments (By Environment / Python)
README
[](https://github.com/asottile/yesqa/actions/workflows/main.yml)
[](https://results.pre-commit.ci/latest/github/asottile/yesqa/main)yesqa
=====A tool (and pre-commit hook) to automatically remove unnecessary `# noqa`
comments, for example: a check that's no longer applicable (say you increased your
max line length), a mistake (`# noqa` added to a line that wasn't failing),
or other code in the file caused it to no longer need a `# noqa` (such as an unused import).## Installation
```bash
pip install yesqa
```## As a pre-commit hook
See [pre-commit](https://github.com/pre-commit/pre-commit) for instructions
Sample `.pre-commit-config.yaml`:
```yaml
- repo: https://github.com/asottile/yesqa
rev: v1.5.0
hooks:
- id: yesqa
```If you need to select a specific version of flake8 and/or run with specific
flake8 plugins, add them to [`additional_dependencies`][0].[0]: http://pre-commit.com/#pre-commit-configyaml---hooks