chore: add black pre-commit hook
This commit is contained in:
parent
62860d0781
commit
fa51738fe8
|
@ -151,21 +151,6 @@ pre-commit:
|
||||||
script:
|
script:
|
||||||
- pre-commit run --all --color=always --show-diff-on-failure
|
- 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:
|
eslint:
|
||||||
interruptible: true
|
interruptible: true
|
||||||
image: node:18-alpine
|
image: node:18-alpine
|
||||||
|
|
|
@ -24,6 +24,11 @@ repos:
|
||||||
- id: mixed-line-ending
|
- id: mixed-line-ending
|
||||||
- id: trailing-whitespace
|
- id: trailing-whitespace
|
||||||
|
|
||||||
|
- repo: https://github.com/psf/black
|
||||||
|
rev: 22.10.0
|
||||||
|
hooks:
|
||||||
|
- id: black
|
||||||
|
|
||||||
- repo: https://github.com/pycqa/flake8
|
- repo: https://github.com/pycqa/flake8
|
||||||
rev: 5.0.4
|
rev: 5.0.4
|
||||||
hooks:
|
hooks:
|
||||||
|
|
|
@ -58,4 +58,5 @@ name = "Update instructions"
|
||||||
showcontent = true
|
showcontent = true
|
||||||
|
|
||||||
[tool.black]
|
[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
|
||||||
|
|
Loading…
Reference in New Issue