blob: 332b02c49560a607adca652ef8358aa455ff82de (
plain)
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
|
# 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.
#
# This adds the following hooks:
#
# - check-case-conflict
# - check-byte-order-marker
# - check-yaml
# - check-json
# - check-xml
# - mixed-line-ending
# - end-of-file-fixer
# - trailing-whitespace
# - no-commit-to-branch
# - eslint
# - clang-format
# - qsscheck
#
# 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/translations/.*\.ts|src/.*_(anlz|pdb)\.h$
default_language_version:
python: python3
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.1.0
hooks:
- id: check-byte-order-marker
exclude: ^.*(\.cbproj|\.groupproj|\.props|\.sln|\.vcxproj|\.vcxproj.filters)$
- id: check-case-conflict
- id: check-json
- id: check-merge-conflict
- id: check-xml
- id: check-yaml
- id: end-of-file-fixer
exclude: \.(c|cc|cxx|cpp|frag|glsl|h|hpp|hxx|ih|ispc|ipp|java|js|m|mm|proto|vert)$
stages:
- commit
- manual
- id: mixed-line-ending
- id: trailing-whitespace
exclude: \.(c|cc|cxx|cpp|frag|glsl|h|hpp|hxx|ih|ispc|ipp|java|js|m|mm|proto|vert)$
stages:
- commit
- manual
- id: no-commit-to-branch
- repo: https://github.com/pre-commit/mirrors-eslint
rev: v7.2.0
hooks:
- id: eslint
args: [--fix, --report-unused-disable-directives]
stages:
- commit
- manual
- repo: local
hooks:
- id: clang-format
name: clang-format
description: "Run clang-format in two passes (reformat, then break long lines)"
entry: tools/clang_format.py
require_serial: true
stages:
- commit
- manual
language: python
files: \.(c|cc|cxx|cpp|frag|glsl|h|hpp|hxx|ih|ispc|ipp|java|m|mm|proto|vert)$
additional_dependencies:
- clang-format
- repo: https://github.com/psf/black
rev: stable
hooks:
- id: black
files: ^tools/.*$
- repo: https://gitlab.com/pycqa/flake8
rev: '3.8.3'
hooks:
- id: flake8
files: ^tools/.*$
types: [text, python]
- repo: local
hooks:
- id: qsscheck
name: qsscheck
description: Run qsscheck to detect broken QSS.
entry: ./tools/qsscheck.py
args: [.]
pass_filenames: false
language: python
additional_dependencies:
- tinycss==0.4
types: [text]
files: ^.*\.qss$
stages:
- commit
- manual
|