-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
147 lines (147 loc) · 5.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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
################################################################################
# OVERVIEW
################################################################################
# The following contains the pre-commit hooks for this repository, which are
# likely a modified version of the author's (AFg6K7h4fhy2) repository template.
#
# Links:
#
# Pre-commit: https://pre-commit.com/
# The author's template: https://github.com/AFg6K7h4fhy2/AFg6K7h4fhy2-Template
# Supported hooks: https://github.com/pre-commit/pre-commit-hooks
repos:
################################################################################
# GENERAL
################################################################################
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
# prevent giant files from being committed.
- id: check-added-large-files
args: ["--maxkb=10000"]
# simply check whether files parse as valid
# python
- id: check-ast
# check for files with names that would
# conflict on a case-insensitive filesystem
# like MacOS HFS+ or Windows FAT.
- id: check-case-conflict
# checks for a common error of placing
# code before the docstring.
- id: check-docstring-first
# attempts to load all yaml files to
# verify syntax.
- id: check-yaml
# allow yaml files which use the
# multi-document syntax
args: ["--allow-multiple-documents"]
# attempts to load all TOML files to
# verify syntax.
- id: check-toml
# makes sure files end in a newline and
# only a newline.
- id: end-of-file-fixer
# replaces or checks mixed line ending.
- id: mixed-line-ending
# verifies that test files are named
# correctly.
- id: name-tests-test
# ensure tests match test_.*\.py
args: ["--pytest-test-first"]
# checks that all your JSON files are pretty.
# "Pretty" here means that keys are sorted
# and indented.
- id: pretty-format-json
# automatically format json files;
# when autofixing, retain the original
# key ordering (instead of sorting
# the keys)
args: ["--autofix", "--no-sort-keys"]
# trims trailing whitespace.
- id: trailing-whitespace
# checks that non-binary executables have
# a proper shebang.
- id: check-executables-have-shebangs
files: \.sh$
# checks for the existence of private keys.
- id: detect-private-key
################################################################################
# PYTHON
################################################################################
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.10.0
hooks:
- id: black
args: ["--line-length", "79"]
language_version: python3
- repo: https://github.com/PyCQA/isort
rev: 5.13.2
hooks:
- id: isort
args: ["--profile", "black", "--line-length", "79"]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.2
hooks:
- id: ruff
args: ["--ignore=E741", "--ignore=E731", "--fix"]
# - repo: https://github.com/pre-commit/mirrors-mypy
# rev: v1.13.0
# hooks:
# - id: mypy
################################################################################
# R
################################################################################
# - repo: https://github.com/lorenzwalthert/precommit
# rev: v0.4.3.9003
# hooks:
# - id: style-files
# - id: lintr
################################################################################
# MAKE FILES
################################################################################
- repo: https://github.com/mrtazz/checkmake.git
rev: 0.2.2
hooks:
- id: checkmake
################################################################################
# SECURITY
################################################################################
# - repo: https://github.com/gitleaks/gitleaks
# rev: v8.19.0
# hooks:
# - id: gitleaks
# - repo: https://github.com/Yelp/detect-secrets
# rev: v1.5.0
# hooks:
# # must first run
# # detect-secrets scan > .secrets.baseline
# - id: detect-secrets
# args: ["--baseline", ".secrets.baseline"]
# exclude: package.lock.json
################################################################################
# GITHUB ACTIONS
################################################################################
- repo: https://github.com/rhysd/actionlint
rev: v1.7.4
hooks:
- id: actionlint
################################################################################
# SPELLING
################################################################################
- repo: https://github.com/crate-ci/typos
rev: typos-dict-v0.11.37
hooks:
- id: typos
args: ["--force-exclude"]
################################################################################
# COMMIT MESSAGES
################################################################################
- repo: https://github.com/commitizen-tools/commitizen
rev: v4.0.0
hooks:
- id: commitizen
- repo: https://github.com/jorisroovers/gitlint
rev: v0.19.1
hooks:
- id: gitlint
################################################################################