guanhailong 2 years ago
parent
commit
94ce04e695
1 changed files with 9 additions and 1 deletions
  1. 9 1
      .pre-commit-config.yaml

+ 9 - 1
.pre-commit-config.yaml

@@ -1,5 +1,5 @@
 repos:
-    # 格式检查和自动格式化
+  # 格式检查和自动格式化
   - repo: https://github.com/PyCQA/isort
     rev: 5.12.0
     hooks:
@@ -23,4 +23,12 @@ repos:
     hooks:
       - id: bandit
 
+  - repo: https://github.com/PyCQA/autoflake
+    rev: 2.2.0
+    hooks:
+      - id: autoflake
+        args:
+          [ "--remove-all-unused-imports",
+            "--remove-unsed-variable", ]
+
 fail_fast: false