-
Notifications
You must be signed in to change notification settings - Fork 166
/
.pre-commit-config.yaml
62 lines (55 loc) · 1.74 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
repos:
- repo: https://github.com/psf/black
rev: 22.12.0
hooks:
- id: black
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
args: ["--profile", "black"]
- repo: https://github.com/pycqa/flake8
rev: 6.0.0
hooks:
- id: flake8
- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v3.0.0"
hooks:
- id: prettier
exclude: \.html$|^docs/
- repo: https://github.com/crate-ci/typos
rev: v1.16.6
hooks:
- id: typos
exclude: index\.html$|elementary_output\.json$
- repo: local
hooks:
- id: no_commit
name: Check for NO_COMMIT marker
entry: bash -c "git diff --cached -U0 | (! grep NO_COMMIT)"
language: system
require_serial: true
pass_filenames: false
- repo: local
hooks:
- id: mypy
name: mypy
entry: mypy --no-error-summary
language: system
files: ^elementary/.*\.py$
- repo: local
hooks:
- id: verify-dbt-project-packages-lock
name: Verify internal dbt project package lock
entry: |
bash -c '
dbt_version=$(python -c "from dbt.version import __version__; print(__version__)");
required_version="1.8";
if [[ $(echo -e "$dbt_version\n$required_version" | sort -V | tail -1) == "$dbt_version" ]]; then
dbt deps --lock --project-dir elementary/monitor/dbt_project && git diff --quiet elementary/monitor/dbt_project/package-lock.yml || (echo "Changes detected in package lock file!" && exit 1);
else
echo "Skipping hook, dbt version is $dbt_version (< 1.8).";
fi
'
language: system
pass_filenames: false