-
Notifications
You must be signed in to change notification settings - Fork 46
/
.gitlint.yaml
236 lines (217 loc) · 6.27 KB
/
.gitlint.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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
# Copyright 2013-2014 Sebastian Kreft
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Regular expression matchers like \d, \w, must be escaped as in \\d, \\w.
# If you need to include a string like '{}' or '{foo}', you need to double the
# braces, as in '{{}}' or '{{foo}}'. See the pylint configuration for an
# example.
# NOTE: filter are regular expressions, and for readability they are broken up
# using '>-' line folding from YAML. This means that between each line a space
# will be added.
# This file is a copy from https://github.com/sk-/git-lint/blob/master/gitlint/configs/config.yaml at commit 763502bdd1809502461759c9817a878a46e7a704
# The file has been changed to suit the linting needs of this repository and the changes can viewed here: https://github.com/Clinical-Genomics/scout/commits/master/.gitlint.yaml
# CSS
# Sample output:
# /path_to/error.css: line 3, col 2, Warning - Duplicate property 'width' found.
csslint:
extensions:
- .css
command: csslint
arguments:
- "--ignore=ids,box-model,adjoining-classes,qualified-headings,\
unique-headings,zero-units"
- --format=compact
filter: >-
^{filename}: line (?P<line>{lines}), col (?P<column>\d+)?,
(?P<severity>\S+) - (?P<message>.+)
installation: >-
Go to https://github.com/stubbornella/csslint/wiki/Command-line-interface
for installation instructions.
# SCSS
# Sample output:
# /path_to/error.scss:2 [W] `0px` should be written without units as `0`
scss:
extensions:
- .scss
command: scss-lint
filter: >-
^{filename}:(?P<line>{lines})(:(?P<column>\d+))?
\[(?P<severity>.+)\]( (?P<message_id>.+):)?
(?P<message>.+)
installation: >-
gem install scss-lint or go to https://github.com/causes/scss-lint
# Javascript
# Sample output:
# Line 1, E:0002: Missing space before "="
gjslint:
extensions:
- .js
command: gjslint
filter: >-
^Line\s+(?P<line>{lines}), (?P<severity>[^: ]+):((?P<message_id>\d+):)?
(?P<message>.+)
installation: >-
Run pip install
http://closure-linter.googlecode.com/files/closure_linter-latest.tar.gz,
or visit https://developers.google.com/closure/utilities/docs/linter_howto
for installation instructions.
# Sample output:
# /path_to/error.js: line 1, col 3, Use '===' to compare with ''.
jshint:
extensions:
- .js
command: jshint
arguments:
- --config
- "{DEFAULT_CONFIGS}/jshint.json"
filter: >-
^{filename}: line (?P<line>{lines}), col (?P<column>\d+), (?P<message>.+)
installation: >-
Visit http://www.jshint.com/install/ for installation instructions.
# Python
pylint:
extensions:
- .py
command: pylint
arguments:
- --rcfile=.configs/pylintrc
- --errors-only
- --output-format=text
- --max-line-length=100
- --jobs=0
- >-
--msg-template={{abspath}}:{{line}}:{{column}}:
[{{category}}:{{symbol}}] {{obj}}: {{msg}}
- --reports=n
filter: >-
^{filename}:(?P<line>{lines}):((?P<column>\d+):)?
\[(?P<severity>.+):(?P<message_id>\S+)\]\s+(:
)?(?P<message>.+)$
installation: "Run pip install pylint."
# Sample output:
# package/module.py:68:80: E501 line too long (80 > 79 characters)
pycodestyle:
extensions:
- .py
command: pycodestyle
arguments:
- "--max-line-length=100"
filter: >-
^{filename}:(?P<line>{lines}):((?P<column>\d+):)?
(?P<message_id>\S+) (?P<message>.+)$
installation: "Run pip install pycodestyle."
# JSON
# Sample output:
# Expecting property name: line 3 column 5 (char 15)
json:
extensions:
- .json
command: python
arguments:
- -m
- json.tool
# enforce that here comes a colon
filter: >-
^(?P<message>[^:]+(?=:
line \d+ column \d+)|No JSON object could be decoded)(:
line (?P<line>\d+) column (?P<column>\d+).*)?$
installation: Nothing else should be required.
# RST
# Sample output:
# /path_to/error.rst:3: (WARNING/2) Inline interpreted text or phrase reference start-string without end-string.
rst:
extensions:
- .rst
command: rst2html.py
filter: >-
^{filename}:(?P<line>{lines}): [(](?P<severity>.+)[)] (?P<message>.+)
installation: Run pip install docutils.
# PNG
pngcrush:
extensions:
- .png
command: pngcrush-linter.sh
requirements:
- pngcrush
filter: (?P<message>.+)$
installation: Run apt-get install pngcrush.
optipng:
extensions:
- .png
command: optipng-linter.sh
requirements:
- optipng
filter: (?P<message>.+)$
installation: Run apt-get install optipng.
# JPEG
jpegtran:
extensions:
- .jpg
- .jpeg
command: jpegtran-linter.sh
requirements:
- jpegtran
filter: (?P<message>.+)
installation: Run apt-get install jpegtran.
# SHELL scripts
# Sample output
# /path_to/error.sh: line 3: syntax error: unexpected end of file
bash:
extensions:
- .sh
command: bash
arguments:
- "-n"
filter: >-
{filename}: line (?P<line>{lines}): (?P<message>.+)
installation: Please install bash in your system.
# YAML
yaml:
extensions:
- .yaml
- .yml
command: yamllint
arguments:
- --format
- parsable
- --config-data
- "{{extends: default, rules: {{document-start: disable, line-length: {{max: 250}}}}}}"
# Matches either:
# - syntax error, on any line
# - other error, on a modified line only
filter: >-
^{filename}:(?P<line>{lines}|\d+(?=:\d+:
\[error\] syntax error:)):(?P<column>\d+):
\[(?P<severity>\S+)\] (?P<message>.+)$
installation: Run pip install yamllint.
# INI
ini:
extensions:
- .ini
- .cfg
command: ini_linter.py
filter: (?P<message>.+)$
installation: ""
# HTML
# Sample output:
# 1:10: Error: Javascript ...
html_lint:
extensions:
- .html
command: html_lint.py
arguments:
- --disable
- optional_tag
installation: pip install html-linter.
filter: >-
^(?P<line>{lines}):(?P<column>\d+): (?P<severity>\S+): (?P<message>.+)