-
Notifications
You must be signed in to change notification settings - Fork 7
/
.pre-commit-config.yaml
83 lines (79 loc) · 2.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
# Check out https://pre-commit.com/ for documentation
# and https://pre-commit.com/hooks.html for more hooks
minimum_pre_commit_version: 2.20.0
# Don't set language_version -- it's only useful if we have multiple
# python versions or our build uses a different env than runtime
repos:
# --- Meta hooks ---
#- hooks:
# This one is useful, but it will fail if, e.g., you don't have a single yaml file
# - id: check-hooks-apply
# This one will fail, e.g., if you don't have a recipes/ file, which is excluded here
# - id: check-useless-excludes
# repo: meta
# --- Built-in hooks --
- hooks:
- id: check-symlinks
- id: check-case-conflict
- id: fix-byte-order-marker
- id: end-of-file-fixer
exclude: "^tests/resources/"
- id: check-merge-conflict
- id: check-toml
- id: check-json
- id: fix-encoding-pragma
args: ["--remove"]
- id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable
- id: trailing-whitespace
# This one is slow and doesn't check for much
# - detect-private-key
# This is very slow, so I recommend disabling it.
#- id: check-added-large-files
# The Conda recipe meta.yaml files are actually templates, not valid YAML
- id: check-yaml
exclude: ^recipes/.*
repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
# --- Commit msg checks ---
- hooks:
- id: commitizen
stages: ["commit-msg"]
repo: https://github.com/commitizen-tools/commitizen
rev: v2.32.0
# --- Strip output from .ipynb files ---
# - hooks:
# - id: nbstripout
# files: ".ipynb"
# repo: https://github.com/kynan/nbstripout
# rev: 0.5.0
# --- Linters ---
- hooks:
- id: dockerfile_lint
repo: https://github.com/Lucas-C/pre-commit-hooks-nodejs
rev: v1.1.2
- repo: https://github.com/pycqa/isort
rev: 5.10.1
hooks:
- id: isort
args: ["--profile", "black"]
# make sure to run black *after* isort
- hooks:
- id: black
repo: https://github.com/psf/black
rev: 22.8.0
- repo: https://github.com/asottile/blacken-docs
rev: v1.12.1
hooks:
- id: blacken-docs
# run black on Jupyter notebooks
- repo: https://github.com/nbQA-dev/nbQA
rev: 1.4.0
hooks:
- id: nbqa-black
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.7.1
hooks:
- id: prettier
stages: [commit]
exclude: ^recipes/.*