diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 61eb5e714..62422c4dd 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -29,6 +29,11 @@ repos: hooks: - id: black + - repo: https://github.com/pycqa/isort + rev: 5.10.1 + hooks: + - id: isort + - repo: https://github.com/pycqa/flake8 rev: 5.0.4 hooks: diff --git a/api/setup.cfg b/api/setup.cfg index a30756860..b36d56491 100644 --- a/api/setup.cfg +++ b/api/setup.cfg @@ -1,6 +1,3 @@ -[isort] -skip_glob = .tox,.git,*/migrations/*,*/static/CACHE/*,docs,node_modules - [pep8] max-line-length = 120 exclude=.tox,.git,*/migrations/*,*/static/CACHE/*,docs,node_modules diff --git a/pyproject.toml b/pyproject.toml index 7455c0fe1..43451f58e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -60,3 +60,8 @@ showcontent = true [tool.black] extend-exclude = "(api/.*/migrations/.*)" force-exclude = "(api/.*/migrations/.*)" # pre-commit pass files as args + +[tool.isort] +profile = "black" +extend_skip_glob = ["api/*/migrations/*"] +known_first_party = ["funkwhale_api", "config"]