-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
99 lines (92 loc) · 2.19 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
# How to use:
# $ pip install pre-commit
# $ cd $git_repo; pre-commit install
#
# To check all files:
# $ pre-commit run --all-files
repos:
#
# Common
#
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0 # Use the ref you want to point at
hooks:
- id: check-added-large-files
- id: check-executables-have-shebangs
- id: check-merge-conflict
- id: check-shebang-scripts-are-executable
- id: check-symlinks
- id: check-toml
- id: check-xml
- id: check-yaml
- id: debug-statements # Python
- id: detect-aws-credentials
args: [--allow-missing-credentials]
- id: detect-private-key
- id: double-quote-string-fixer
- id: end-of-file-fixer
- id: mixed-line-ending
args: [--fix=no]
- id: trailing-whitespace
# For ignoring false positives see
# https://github.com/crate-ci/typos?tab=readme-ov-file#false-positives
- repo: https://github.com/crate-ci/typos
rev: v1.24.6
hooks:
- id: typos
#
# Python
#
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
name: isort (python)
- repo: https://github.com/google/yapf
rev: v0.40.2
hooks:
- id: yapf
- repo: local
hooks:
# pylint: https://pylint.pycqa.org/en/latest/user_guide/installation/pre-commit-integration.html
- id: pylint
name: pylint
entry: bash -c 'PYTHONPATH=/r/lib/python:/repos/secrets pylint $@'
language: system
types: [python]
require_serial: true
args: [
"-rn", # Only display messages
"-sn", # Don't display the score
"-d invalid-name",
"-d line-too-long",
"-d missing-function-docstring",
"-d missing-class-docstring",
"-d missing-module-docstring",
"-d redefined-outer-name",
"-d too-few-public-methods",
"-d too-many-locals",
"-d unspecified-encoding",
"-d wrong-import-order",
"-d too-many-arguments",
"-d too-many-branches",
"-d too-many-positional-arguments",
]
#
# Shell
#
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.10.0.1
hooks:
- id: shellcheck
args: [
"-eSC1090,SC1091,SC2002",
"-sbash",
]
#
# JSON with comments
#
- repo: https://gitlab.com/bmares/check-json5
rev: v1.0.0
hooks:
- id: check-json5