-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
.pre-commit-config.yaml
172 lines (171 loc) · 5.52 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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
# This is the configuration file for the pre-commit framework, a simple way
# to manage, install and run git hooks to catch common problems early on.
# See https://pre-commit.com/ for details.
#
# If you have Python >= 3.7 and python-pip installed, just run:
#
# $ pip install --user pre-commit
# $ git clone https://github.com/your-fork-of/mixxx.git
# $ cd mixxx
# $ pre-commit install
# $ pre-commit install -t pre-push
#
# It will now run relevant hooks automatically on every `git commit` or
# `git push` in the mixxx git repository.
#
# If you have a problems with a particular hook, you can use the `$SKIP`
# environment variable to disable hooks:
#
# $ SKIP=clang-format,end-of-file-fixer git commit
#
# This can also be used to separate logic changes and autoformatting into
# two subsequent commits.
#
# Using the `$SKIP` var is preferable to using `git commit --no-verify`
# because it won't prevent catching other, unrelated issues.
# _anlz.h/_pdb.h: Header files generated by Kaitai Struct
exclude: ^(lib/|src/test/.*data/).*|res/controllers/lodash\.mixxx\.js|res/translations/.*\.ts|src/.*_(anlz|pdb)\.h$
minimum_pre_commit_version: 2.21.0
default_language_version:
python: python3
rust: 1.64.0
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: fix-byte-order-marker
exclude: ^.*(\.cbproj|\.groupproj|\.props|\.sln|\.vcxproj|\.vcxproj.filters|UTF-8-BOM.txt)$
- id: check-case-conflict
- id: check-json
- id: check-merge-conflict
- id: check-xml
- id: check-yaml
exclude: ^\.clang-format$
- id: end-of-file-fixer
exclude: ^.*UTF-8-BOM.txt$
- id: mixed-line-ending
- id: trailing-whitespace
exclude: \.(c|cc|cxx|cpp|d.ts|frag|glsl|h|hpp|hxx|ih|ispc|ipp|java|js|m|mm|proto|vert)$
- id: no-commit-to-branch
# protect main and any branch that has a semver-like name
args: [-b, main, -p, '^\d+\.\d+(?:\.\d+)?$']
- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
hooks:
- id: codespell
args:
[
--exclude-file,
.codespellignorelines,
--ignore-words,
.codespellignore,
--ignore-regex,
"\\W(?:m_p*(?=[A-Z])|m_(?=\\w)|pp*(?=[A-Z])|k(?=[A-Z])|s_(?=\\w))",
--write-changes,
]
exclude: ^(packaging/wix/LICENSE.rtf.in|src/dialog/dlgabout\.cpp|.*\.(?:pot?|(?<!d\.)ts|wxl|svg))$
- repo: https://github.com/pre-commit/mirrors-eslint
rev: v9.14.0
hooks:
- id: eslint
args: [--fix, --report-unused-disable-directives]
files: \.m?[jt]s$
types: [file]
stages:
- pre-commit
- manual
additional_dependencies:
- eslint@^9.14.0
- eslint-plugin-jsdoc@^v50.4.3
- "@typescript-eslint/eslint-plugin"
- "@typescript-eslint/parser"
- eslint-plugin-diff@^2.0.3
- repo: local
hooks:
- id: clang-format
name: clang-format
description: "Run clang-format in two passes (reformat, then break long lines)"
entry: python tools/clang_format.py
require_serial: true
stages:
- pre-commit
- manual
language: python
additional_dependencies:
- clang-format==19.1.3
files: \.(c|cc|cxx|cpp|frag|glsl|h|hpp|hxx|ih|ispc|ipp|java|m|mm|proto|vert)$
- repo: https://github.com/psf/black
rev: 24.10.0
hooks:
- id: black
files: ^tools/.*$
- repo: https://github.com/pycqa/flake8
rev: "7.1.1"
hooks:
- id: flake8
files: ^tools/.*$
types: [text, python]
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.10.0.1
hooks:
- id: shellcheck
- repo: https://github.com/DavidAnson/markdownlint-cli2
rev: v0.14.0
hooks:
- id: markdownlint-cli2
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.29.4
hooks:
- id: check-github-workflows
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v4.0.0-alpha.8
hooks:
- id: prettier
types: [yaml]
- repo: https://github.com/qarmin/qml_formatter.git
rev: 37c2513b1b8275a475a160ed2f5b044910335d5f # No release tag yet including #6 fix
hooks:
- id: qml_formatter
- repo: local
hooks:
- id: qsscheck
name: qsscheck
description: Run qsscheck to detect broken QSS.
entry: python tools/qsscheck.py
args: [.]
pass_filenames: false
language: python
additional_dependencies:
- tinycss==0.4
types: [text]
files: ^.*\.qss$
stages:
- pre-commit
- manual
- id: changelog
name: changelog
description: Add missing links to changelog.
entry: python tools/changelog.py
language: python
types: [text]
files: ^CHANGELOG.md$
- id: qmllint
name: qmllint
entry: qmllint
pass_filenames: true
require_serial: true
language: system
types: [text]
files: ^.*\.qml$
- id: metainfo
name: metainfo
description: Update AppStream metainfo releases from CHANGELOG.md.
entry: python tools/update_metainfo.py
pass_filenames: false
language: python
additional_dependencies:
- beautifulsoup4==4.12.3
- lxml==5.3.0
- Markdown==3.7
types: [text]
files: ^(CHANGELOG\.md|res/linux/org\.mixxx\.Mixxx\.metainfo.xml)$