chore: add black pre-commit hook
This commit is contained in:
parent
62860d0781
commit
fa51738fe8
|
@ -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
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue