Registry / testing / yesqa
library1.5.0pypypi✓ verified 71d ago

yesqa automatically removes unnecessary `# noqa` comments from Python code. It works by running flake8 (or other supported linters) to determine which noqa directives are actually needed. Current version is 1.5.0, released as a command-line tool with no Python API. Maintenance is active.

pip install yesqa
INSTALL
IMPORT
SIG · YESQA
Y
yesqa
testingpythonv1.5.0
Install
1.8s avg
Import
45ms
Disk
17MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.5.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.048s · 19.3MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.8s · import 0.042s · 20MB
17MB installed
● package 17MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

main
import yesqa
yesqa is primarily used as a CLI tool. The Python module exists but exposes only the internal main function. Use command line instead.

Basic usage: run 'yesqa <file>' to remove unnecessary noqa comments. The tool reads flake8 configuration from setup.cfg, tox.ini, or .flake8 automatically.

# Run yesqa on a single file yesqa myfile.py # Run yesqa on all Python files in a directory (using find) find . -name '*.py' -exec yesqa {} + # Run with flake8 options (passed through to flake8) yesqa --ignore E501 myfile.py
yesqa --version
Debug
Known issues
gotchayesqa does not work without flake8 or a compatible linter installed. It relies on flake8's AST to determine which noqa comments are needed. Without flake8, yesqa will raise an ImportError.
fix
Ensure flake8 is installed: pip install flake8
affects: all
gotchaRunning yesqa on a file that already has noqa comments on every line may remove all of them if they are all unnecessary, potentially exposing previously ignored lint errors. Always review the diff.
fix
Use version control to review changes: 'git diff' before committing.
affects: all
deprecatedyesqa versions prior to 1.0.0 used a different CLI interface. If you have an old script using 'python -m yesqa' without arguments, it may not work as expected.
fix
Update to latest version: pip install --upgrade yesqa
affects: <1.0.0
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'flake8'
yesqa requires flake8 to be installed in the same Python environment.
fix
Run 'pip install flake8' to install flake8.
yesqa: error: argument filename: expected one argument
yesqa requires at least one filename as argument. Running without arguments is not supported.
fix
Specify a file or use wildcard: 'yesqa *.py'
Cannot find configuration for flake8 in setup.cfg or .flake8
yesqa looks for flake8 configuration files. If missing, it may not detect custom error codes.
fix
Create a flake8 configuration file (e.g., .flake8) in your project root.
Upgrade
Version history
1.5.0latest on PyPI · released Jun 10, 2023
Audit
Dependencies
flake8requiredyesqa uses flake8 under the hood to detect unnecessary noqa comments.
Agent activity
25 hits · last 30 days
node
22
Amazon
1
Resources
yesqa — pip install yesqa · libregistry