Skip to navigation
Autoflake
24.10.24
autoflake --in-place --remove-unused-variables *.py usage: autoflake [-h] [-c | -cd] [-r] [-j n] [--exclude globs] [--imports IMPORTS] [--expand-star-imports] [--remove-all-unused-imports] [--ignore-init-module-imports] [--remove-duplicate-keys] [--remove-unused-variables] [--remove-rhs-for-unused-variables] [--ignore-pass-statements] [--ignore-pass-after-docstring] [--version] [--quiet] [-v] [--stdin-display-name STDIN_DISPLAY_NAME] [--config CONFIG_FILE] [-i | -s] files [files ...] Removes unused imports and unused variables as reported by pyflakes. positional arguments: files files to format options: -h, --help show this help message and exit -c, --check return error code if changes are needed -cd, --check-diff return error code if changes are needed, also display file diffs -r, --recursive drill down directories recursively -j n, --jobs n number of parallel jobs; match CPU count if value is 0 (default: 0) --exclude globs exclude file/directory names that match these comma-separated globs --imports IMPORTS by default, only unused standard library imports are removed; specify a comma-separated list of additional modules/packages --expand-star-imports expand wildcard star imports with undefined names; this only triggers if there is only one star import in the file; this is skipped if there are any uses of `__all__` or `del` in the file --remove-all-unused-imports remove all unused imports (not just those from the standard library) --ignore-init-module-imports exclude __init__.py when removing unused imports --remove-duplicate-keys remove all duplicate keys in objects --remove-unused-variables remove unused variables --remove-rhs-for-unused-variables remove RHS of statements when removing unused variables (unsafe) --ignore-pass-statements ignore all pass statements --ignore-pass-after-docstring ignore pass statements after a newline ending on '"""' --version show program's version number and exit --quiet Suppress output if there are no issues -v, --verbose print more verbose logs (you can repeat `-v` to make it more verbose) --stdin-display-name STDIN_DISPLAY_NAME the name used when processing input from stdin --config CONFIG_FILE Explicitly set the config file instead of auto determining based on file location -i, --in-place make changes to files instead of printing diffs -s, --stdout print changed text to stdout. defaults to true when formatting stdin, or to false otherwise
https://github.com/PyCQA/autoflake?ysclid=m2mui1e8g7246421280
Reply
Anonymous
Information Epoch 1732182706
Worse is better.
Home
Notebook
Contact us