forked from USEPA/haztrak
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
62 lines (61 loc) · 1.81 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
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
ci:
autofix_commit_msg: |
[pre-commit.ci] auto fixes from pre-commit.com hooks
autoupdate_branch: "pre-commit"
autoupdate_commit_msg: "[pre-commit.ci] pre-commit autoupdate"
autoupdate_schedule: quarterly
skip: []
submodules: false
repos:
# Pre-commit hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v4.5.0"
hooks:
- id: trailing-whitespace
- id: check-json
- id: check-yaml
exclude: infra/haztrak/
- id: end-of-file-fixer
# https://regex101.com/r/cDOFR1/1
exclude: (?x)^(\.idea\/.*|\.vscode\/.*)$
# Ruff
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.6.8
hooks:
- id: ruff
args: [--fix, --config, ./server/pyproject.toml]
- id: ruff-format
args: [--config, ./server/pyproject.toml]
# Check django migrations
- repo: local
hooks:
- id: pre-commit-django-migrations
name: Check django migrations
entry: env DJANGO_SETTINGS_MODULE=haztrak.settings.dev python server/manage.py makemigrations --check
language: system
types:
- python
pass_filenames: false
# Eslint
- repo: https://github.com/pre-commit/mirrors-eslint
rev: "v9.8.0"
hooks:
- id: eslint
files: ^client/.*\.[jt]sx?$
args: [-c=client/eslint.config.js]
types: [file]
# Prettier
- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v3.1.0"
hooks:
- id: prettier
exclude: infra/haztrak/
# https://regex101.com/r/mVcK66/1
files: ^(client/.*\.[jt]sx?|.*\.md|.*\.yaml)$
# PyUpgrade
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
hooks:
- id: pyupgrade