소스 검색

autoflake: add page (#1853)

Andrew Dassonville 7 년 전
부모
커밋
b8d0eaa03e
1개의 변경된 파일19개의 추가작업 그리고 0개의 파일을 삭제
  1. 19 0
      pages/common/autoflake.md

+ 19 - 0
pages/common/autoflake.md

@@ -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}}`