diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1c1a52b94..bc7384250 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -151,21 +151,6 @@ pre-commit: script: - pre-commit run --all --color=always --show-diff-on-failure -black: - interruptible: true - image: python:3.11 - stage: lint - variables: - GIT_STRATEGY: fetch - before_script: - - pip install black - script: - - black --check --diff . - rules: - - if: $CI_PIPELINE_SOURCE == "merge_request_event" - changes: - - api/**/* - eslint: interruptible: true image: node:18-alpine diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d69625fec..61eb5e714 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,6 +24,11 @@ repos: - id: mixed-line-ending - id: trailing-whitespace + - repo: https://github.com/psf/black + rev: 22.10.0 + hooks: + - id: black + - repo: https://github.com/pycqa/flake8 rev: 5.0.4 hooks: diff --git a/pyproject.toml b/pyproject.toml index 555789822..7455c0fe1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -58,4 +58,5 @@ name = "Update instructions" showcontent = true [tool.black] -exclude = "(.git|.hg|.mypy_cache|.tox|.venv|_build|buck-out|build|dist|migrations|data)" +extend-exclude = "(api/.*/migrations/.*)" +force-exclude = "(api/.*/migrations/.*)" # pre-commit pass files as args