1
0
Fork 0

add autoflake to remove unused imports

This commit is contained in:
Maurizio Porrato 2023-08-20 09:11:13 +01:00
parent 96eba138d2
commit db415d8f91
4 changed files with 19 additions and 1 deletions

View File

@ -7,6 +7,10 @@ repos:
- id: check-toml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/PyCQA/autoflake
rev: v2.2.0
hooks:
- id: autoflake
- repo: https://github.com/psf/black
rev: 23.7.0
hooks:

View File

@ -35,6 +35,7 @@ lint = [
"mypy>=1.5.1",
"bandit[toml]>=1.7.5",
"tox-pdm>=0.6.1",
"autoflake>=2.2.0",
]
[tool.pylint.main]
@ -52,3 +53,9 @@ ignored-argument-names = "_.*|^ignored_|^unused_"
[tool.bandit]
exclude_dirs = ["tests", ".tox", ".venv"]
[tool.autoflake]
recursive = true
remove-all-unused-imports=true
remove-duplicate-keys = true
remove-unused-variables = true

View File

@ -1,4 +1,3 @@
import re
from pathlib import Path
from typing import Any, Union

View File

@ -32,3 +32,11 @@ groups =
lint
commands =
bandit -c pyproject.toml -r .
[testenv:format]
groups =
lint
commands =
autoflake --in-place src tests
isort src tests
black src tests