-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.pre-commit-config.yaml
98 lines (98 loc) · 3.47 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# See https://pre-commit.com for more information
repos:
# Potpourri of hooks provided by github.
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-docstring-first
- id: check-json
exclude: docs/dev
- id: check-merge-conflict
- id: check-shebang-scripts-are-executable
- id: check-xml
- id: check-toml
- id: check-yaml
exclude: (deploy/host_vars|deploy/stack|deploy)
- id: debug-statements
- id: detect-aws-credentials
args: [--allow-missing-credentials]
- id: detect-private-key
- id: end-of-file-fixer
exclude: revengine/static/apple-developer-merchantid-domain-association
- id: trailing-whitespace
# Python security checks
- repo: https://github.com/PyCQA/bandit
rev: 1.8.0
hooks:
- id: bandit
args:
[
"--severity-level=high",
"--confidence-level=medium",
"-c",
"pyproject.toml",
"-r",
".",
]
additional_dependencies: ["bandit[toml]"]
types: [python]
# Black code formatter.
- repo: https://github.com/psf/black
rev: 24.10.0
hooks:
- id: black
language_version: python3.10
# Ruff code linter.
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.4
hooks:
- id: ruff
args: [ --fix ]
# Check Python dependencies against p0wned package database.
- repo: https://github.com/Lucas-C/pre-commit-hooks-safety
rev: v1.3.3
hooks:
- id: python-safety-dependencies-check
files: pyproject.toml
args: [
"--ignore=66963", # djangorestframework-simplejwt <= 5.3.1, no fixed version available yet
]
# Checks no secrets in code.
- repo: https://github.com/thoughtworks/talisman
rev: v1.32.0
hooks:
- id: talisman-commit
entry: bash -c 'if [ -n "${TALISMAN_HOME:-}" ]; then ${TALISMAN_HOME}/talisman_hook_script pre-commit; else echo "TALISMAN does not exist. Consider installing from https://github.com/thoughtworks/talisman . If you already have talisman installed, please ensure TALISMAN_HOME variable is set to where talisman_hook_script resides, for example, TALISMAN_HOME=${HOME}/.talisman/bin"; fi'
# JS formater.
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.3
hooks:
- id: prettier
types_or: [javascript, ts, tsx]
# JS code linter.
- repo: https://github.com/pre-commit/mirrors-eslint
rev: v8.55.0
hooks:
- id: eslint
files: \.[jt]sx?$ # *.js, *.jsx, *.ts and *.tsx
types: [file]
args: ["--config", "spa/.eslintrc.json", "spa/src"]
additional_dependencies:
- "@typescript-eslint/parser@^5.54.0"
- "@typescript-eslint/eslint-plugin@^5.54.0"
- eslint-config-prettier@^8.8.0
- eslint-plugin-chai-friendly@^0.7.2
- eslint-plugin-cypress@^2.13.3
- eslint-plugin-jest@^27.6.0
- eslint-plugin-jsx-a11y@^6.8.0
- eslint-plugin-react@^7.33.2
- eslint-plugin-react-hooks@^4.6.0
- eslint-plugin-testing-library@^6.1.0
# TODO: DEV-1763 Disabled as it complains that `FROM base AS deploy needs to specific tag, but opinions vary.
# # Docker file formatter/checker.
# - repo: https://github.com/pryorda/dockerfilelint-precommit-hooks
# rev: v0.1.0
# hooks:
# - id: dockerfilelint
# stages: [commit]