1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-22 00:42:08 +02:00

autoflake: add page (#1853)

This commit is contained in:
Andrew Dassonville 2018-01-02 02:33:12 -08:00 committed by Starbeamrainbowlabs
parent 2a35fd6627
commit b8d0eaa03e

19
pages/common/autoflake.md Normal file
View file

@ -0,0 +1,19 @@
# autoflake
> A tool to remove unused imports and variables from Python code.
- Remove unused variables from a single file and display the diff:
`autoflake --remove-unused-variables {{file.py}}`
- Remove unused imports from multiple files and display the diffs:
`autoflake --remove-all-unused-imports {{file1.py}} {{file2.py}} {{file3.py}}`
- Remove unused variables from a file, overwriting the file:
`autoflake --remove-unused-variables --in-place {{file.py}}`
- Remove unused variables recursively from all files in a directory, overwriting each file:
`autoflake --remove-unused-variables --in-place --recursive {{path/to/directory}}`