chore: add black pre-commit hook

environments/review-docs-docs-detqeo/deployments/15752
jo 2022-11-19 15:27:03 +01:00 zatwierdzone przez JuniorJPDJ
rodzic 62860d0781
commit fa51738fe8
3 zmienionych plików z 7 dodań i 16 usunięć

Wyświetl plik

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

Wyświetl plik

@ -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:

Wyświetl plik

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