-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
45 lines (45 loc) · 1.85 KB
/
.pre-commit-config.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
fail_fast: true
repos:
- repo: https://github.com/python-poetry/poetry
rev: '1.8.3' # add version here
hooks:
- id: poetry-check
- id: poetry-lock
- repo: local
hooks:
- id: black
name: black
entry: poetry run black
language: system
types: [ file, python ]
- id: isort
name: isort
entry: poetry run isort
language: system
types: [ file, python ]
- id: ruff linter
name: ruff lint
entry: poetry run ruff check --fix
language: system
types: [ file, python ]
- id: bandit
name: bandit
entry: poetry run bandit -c pyproject.toml -r .
language: system
types: [ file, python, toml ]
- id: xenon
name: xenon
entry: bash -c "poetry run xenon -a $(poetry run python -c \"import tomllib; f = open('pyproject.toml','rb') ; data = tomllib.load(f); f.close(); print(data['tool']['quality']['mccabe']['average'])\") -b $(poetry run python -c \"import tomllib; f = open('pyproject.toml','rb') ; data = tomllib.load(f); f.close(); print(data['tool']['quality']['mccabe']['block'])\") -m $(poetry run python -c \"import tomllib; f = open('pyproject.toml','rb') ; data = tomllib.load(f); f.close(); print(data['tool']['quality']['mccabe']['module'])\") . "
language: system
types: [ file, python, toml ]
- id: mypy
name: mypy
# entry: poetry run mypy --no-namespace-packages --exclude CEDA Backstage Template Experiment 19/models/__init__.py
entry: poetry run mypy --no-namespace-packages
language: system
types: [ file, python, toml ]
- id: docs
name: docs
entry: bash -c "poetry run sphinx-build -M dummy ./docs ./docs/_build -W -q -a"
language: system
types_or: [ file, python, rst, toml, markdown ]