-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
84 lines (77 loc) · 2.15 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
# Pre-commit configuration file
#
# If it's your first time run:
# $ python -m pre_commit install --hook-type pre-commit --hook-type pre-push
#
# To run these hooks locally:
# $ python -m pre_commit run --all-files
#
# To update these hooks:
# $ python -m pre_commit autoupdate
#
# References:
# https://pre-commit.com/index.html
repos:
# baseline consistency checks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: check-json
- id: check-merge-conflict
- id: check-symlinks
- id: check-toml
- id: check-xml
- id: check-yaml
args: [ --allow-multiple-documents ]
- id: detect-aws-credentials
args: [ --allow-missing-credentials ]
- id: detect-private-key
- id: end-of-file-fixer
- id: mixed-line-ending
- id: pretty-format-json
args: [ --no-sort-keys, --autofix ]
- id: trailing-whitespace
# validate pyproject.toml file
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.16
hooks:
- id: validate-pyproject
# some useful and quality-of-life checks for shell scripts
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.10.0.1
hooks:
- id: shellcheck
# fix spelling
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
hooks:
- id: codespell
additional_dependencies:
- tomli
# ensure commit messages format consistency
- repo: https://github.com/commitizen-tools/commitizen
rev: v3.24.0
hooks:
- id: commitizen
# code quality checks
- repo: local
hooks:
- id: linting
name: linting
entry: python -m nox -s linting_check
pass_filenames: false
language: system
types: [ python ]
require_serial: true
stages: [ push ]
- id: formatting
name: formatting
entry: python -m nox -s formatting_check
files: 'src|tests|noxfile.py'
pass_filenames: false
language: system
types: [ python ]
require_serial: true
stages: [ push ]