-
Notifications
You must be signed in to change notification settings - Fork 4
/
.pre-commit-config.yaml
107 lines (96 loc) · 3.31 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
99
100
101
102
103
104
105
106
107
---
repos:
- repo: https://github.com/PyCQA/bandit
rev: 1.7.4
hooks:
- id: bandit
exclude: tests/.*$
# For IDE-integration outside of the pre-commit hook,
# see: https://black.readthedocs.io/en/stable/editor_integration.html
- repo: https://github.com/ambv/black
rev: 22.8.0
hooks:
- id: black
args: [--config=pyproject.toml]
exclude: ^{{cookiecutter\.project_slug}}/tests/test_main\.py$
- repo: https://github.com/Yelp/detect-secrets
rev: v1.3.0
hooks:
- id: detect-secrets
exclude: poetry.lock
- repo: https://github.com/hadolint/hadolint
rev: v2.12.0
hooks:
- id: hadolint-docker
name: hadolint
args: [--ignore=DL4003]
- repo: https://github.com/Lucas-C/pre-commit-hooks-nodejs
rev: v1.1.2
hooks:
- id: markdown-toc
args: [--maxdepth=3, -i]
exclude: ^(docs/source/.*)|({{cookiecutter\.project_slug}}/(README\.md|docs/source/.*))$
- repo: local
hooks:
- id: mypy
name: mypy
language: system
# False-positives from cookiecutter Jinja2 template syntax =>
# print output but always succeed.
# see: https://stackoverflow.com/a/59745587
verbose: true
entry: bash -c '.tox/precommit/bin/mypy "$@" || true' --
args: [--cache-dir=/dev/null, --config-file=pyproject.toml]
types: [python]
- repo: https://github.com/jumanjihouse/pre-commit-hooks
rev: 3.0.0
hooks:
- id: script-must-have-extension
- id: script-must-not-have-extension
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.220
hooks:
- id: ruff
# False-positives from cookiecutter Jinja2 template syntax =>
# print output but always succeed.
# see: https://stackoverflow.com/a/59745587
verbose: true
entry: bash -c 'ruff "$@" || true' --
- repo: https://github.com/koalaman/shellcheck-precommit
rev: v0.8.0
hooks:
- id: shellcheck
args:
- --external-sources
types: [shell]
- repo: https://github.com/scop/pre-commit-shfmt
rev: v3.5.1-2
hooks:
- id: shfmt-docker # Docker image (requires Docker to run)
args:
# Formatting options based on Google's shell style guidelines
# see:
# - https://www.mankier.com/1/shfmt#Examples
# - https://www.mankier.com/1/shfmt#Options
- --binary-next-line
- --case-indent
- --indent=2
- --write
types: [shell]
- repo: https://github.com/adrienverge/yamllint
rev: v1.28.0
hooks:
- id: yamllint
args: ['-d {extends: default, rules: {line-length: {max: 120, level: warning}}}']
exclude: ^{{cookiecutter\.project_slug}}/\.github/workflows/(auto-merge-dependabot|ci|release|publish_benchmarks|publish_log4brains)\.yml$
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: check-added-large-files # Ignored for git-lfs files
args: [--maxkb=100000] # 100MB
- id: debug-statements
exclude: ^{{cookiecutter.project_slug}}/tests/test_main\.py
- id: end-of-file-fixer # Ensure files ONLY end in a newline
exclude_types: [jupyter]
- id: trailing-whitespace # Trim
args: [--markdown-linebreak-ext=md]