-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
155 lines (155 loc) · 4.96 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
148
149
150
151
152
153
154
155
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.2.0
hooks:
- id: check-xml
- id: check-yaml
- id: check-toml
- id: check-json
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-added-large-files
- id: check-case-conflict
- id: detect-private-key
- id: check-docstring-first
- id: check-merge-conflict
- id: check-shebang-scripts-are-executable
exclude: |
(?x)^(
shell/init/profile|
shell/init/shellrc.sh|
shell/init/shellrc.csh
)$
- id: check-vcs-permalinks
- id: check-symlinks
- id: mixed-line-ending
# - id: pretty-format-json
- repo: https://github.com/jumanjihouse/pre-commit-hooks
rev: 2.1.6 # or master
hooks:
# TODO: Migrate some checks to python to make them "universal"
# - id: bundler-audit
# - id: check-mailmap # Depends on sh, does not work in Powershell/Windows
- id: forbid-binary
# - id: forbid-space-in-indent
# - id: git-check # Configure in .gitattributes, Depends on sh, does not work in Powershell/Windows
# - id: git-dirty # Configure in .gitignore
# - id: markdownlint # Configure in .mdlrc, depends on Ruby
# - id: protect-first-parent # TODO: This fails in GH CI since Ubuntu 20.04 has an old Git version
# - id: require-ascii
# - id: script-must-have-extension
# - id: script-must-not-have-extension
# - id: shellcheck
# - id: shfmt
# TODO: Migrate this to local scripts
# - repo: https://github.com/Lucas-C/pre-commit-hooks
# rev: v1.2.0
# hooks:
# - id: remove-crlf
# - id: remove-tabs
# exclude: |
# (?x)^(
# UltiSnips/.*|
# Makefile.*|
# \.git.*|
# .*\.make|
# .*\.go$
# )$
# # args: [ '--whitespaces-count', '2' ] # defaults to: 4
- repo: https://github.com/sirosen/check-jsonschema
rev: 0.15.0
hooks:
- id: check-github-workflows
- id: check-github-actions
# - id: check-jsonschema
# - id: check-azure-pipelines
# - id: check-travis
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.1.7
hooks:
- id: ruff
# - id: ruff-format
# - repo: https://github.com/PyCQA/flake8
# rev: '4.0.1' # Use the sha / tag you want to point at
# hooks:
# - id: flake8
# # args: [
# # '--max-line-length=120',
# # '--ignore=E203,E226,E231,E261,E262,E265,E302,W391'
# # ]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v0.950' # Use the sha / tag you want to point at
hooks:
- id: mypy
# args: [--ignore-missing-imports]
- repo: https://github.com/psf/black
rev: 22.3.0 # Latest: 21.7b0 or stable
hooks:
- id: black
language_version: python3
args: [ --check, --diff ]
- repo: local
hooks:
- id: shellcheck
name: shellcheck
description: Shell correctness
entry: shellcheck
args: ['-f', 'gcc', '-x', '-e', '1117']
exclude: |
(?x)^(
shell/zfunctions/.*|
shell/scripts/.*|
bin/converter.sh|
.*\.(t)?csh|
.*zsh.*|
.*\.zsh
)$
language: system
types: [shell]
- id: shfmt
name: shfmt
description: Format shell scripts
entry: shfmt
args: ['-i', '4', '-s', '-ci', '-kp', '-d']
exclude: |
(?x)^(
shell/zfunctions/.*|
shell/scripts/.*|
.*\.(t)?csh|
.*zsh.*|
.*\.zsh
)$
types: [shell]
language: system
- id: luacheck
name: luacheck
description: Lua check
entry: luacheck
# TODO: Fix completxity before adding this back '--max-cyclomatic-complexity', '20',
args: ['--std', 'lua54', '--formatter', 'plain', '--codes']
language: system
types: [lua]
- id: stylua
name: stylua
description: Format Lua files
entry: stylua
args: [--check, --verify]
language: system
types: [lua]
# language: golang
# minimum_pre_commit_version: 2.4.0
# additional_dependencies: [mvdan.cc/sh/v3/cmd/[email protected]]
# - id: flake8
# name: flake8
# description: '`flake8` is a command-line utility for enforcing style consistency across Python projects.'
# entry: flake8
# args: [
# '--max-line-length=120',
# '--ignore=E203,E226,E231,E261,E262,E265,E302,W391'
# ]
# language: system
# types: [python]
# require_serial: true