-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtool-definitions.yaml
260 lines (260 loc) · 8.87 KB
/
tool-definitions.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
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/mattn/efm-langserver/master/schema.json
tools:
action-lint: &action-lint
# go install github.com/rhysd/actionlint/cmd/actionlint@latest
lint-command: >
env input=${INPUT} substr=.github/workflows sh -c
'[ "${input#*$substr}" != "$input" ] &&
actionlint -no-color -
$([ -f .github/actionlint.yaml ] && echo "-config-file .github/actionlint.yaml")
$([ -f .github/actionlint.yml ] && echo "-config-file .github/actionlint.yml")'
lint-source: "action-lint"
lint-stdin: true
lint-formats:
- '%f:%l:%c:%m'
alex: &alex
# npm install -g alex
lint-command: 'PATH="./node_modules/.bin:$PATH" alex --stdin'
lint-formats:
- ' %l:%c-%e:%k %terror %m'
- ' %l:%c-%e:%k %tarning %m'
lint-source: 'alex'
lint-stdin: true
root-markers:
- 'package.json'
ameba: &ameba
# https://github.com/crystal-ameba/ameba
lint-command: 'PATH="./bin:$PATH" ameba --no-color --format flycheck ${INPUT}'
lint-formats:
- '%.%#:%l:%c: %t: %m'
lint-ignore-exit-code: true
lint-source: 'ameba'
lint-stdin: false
root-markers:
- '.ameba.yml'
black: &black
# pip install black
format-command: 'black --no-color -q -'
format-stdin: true
root-markers:
- pyproject.toml
- requirements.txt
checkmake: &checkmake
# go install github.com/mrtazz/checkmake/cmd/checkmake@latest
lint-command: |
checkmake --format='{{.LineNumber}}:{{.Violation}} ({{.Rule}})
' "${INPUT}"
lint-formats:
- '%l:%m'
lint-severity: 2 # Display at "warning" level
lint-source: 'checkmake'
lint-stdin: false
chktex: &chktex
# https://www.nongnu.org/chktex/
lint-command: 'chktex -q -v0'
lint-formats:
- '%f:%l:%c:%n:%m'
lint-ignore-exit-code: true
lint-severity: 2 # Display at "warning" level
lint-source: 'chktex'
lint-stdin: true
cmake-lint: &cmake-lint
# pip install cmakelang
lint-command: 'cmake-lint "${INPUT}"'
lint-formats:
- '%f:%l,%c: [%s] %m'
lint-source: 'cmake-lint'
lint-stdin: false
cmake-format: &cmake-format
# @deprecated in favor of https://github.com/regen100/cmake-language-server
# WARNING: https://github.com/creativenull/efmls-configs-nvim/issues/64
# pip install cmakelang
format-command: 'cmake-format "${INPUT}"'
format-stdin: false
fixit: &fixit
# pip install --pre "fixit >1"
lint-command: 'fixit lint - ${INPUT}'
lint-formats:
- '%f@%l:%c %m'
lint-ignore-exit-code: true
lint-severity: 2 # Display at "warning" level (Fixit 2 Violations don't specify severity)
lint-source: 'fixit2'
lint-stdin: true
root-markers:
- 'pyproject.toml'
- 'requirements.txt'
- '.fixit.toml'
- 'fixit.toml'
forge-fmt: &forge-fmt
# curl -L https://foundry.paradigm.xyz | bash
# foundryup
format-command: 'forge fmt --raw -'
format-stdin: true
root-markers:
- foundry.toml
hadolint: &hadolint
# brew install hadolint
lint-command: 'hadolint --no-color -'
lint-formats:
- '-:%l %.%# %trror: %m'
- '-:%l %.%# %tarning: %m'
- '-:%l %.%# %tnfo: %m'
lint-source: 'hadolint'
lint-stdin: true
root-markers:
- '.hadolint.yaml'
luacheck: &luacheck
# luarocks install luacheck
lint-command: 'luacheck --codes --no-color --quiet -'
lint-formats:
- '%.%#:%l:%c: (%t%n) %m'
lint-source: 'luacheck'
lint-stdin: true
root-markers:
- '.luacheckrc'
prettierd: &prettierd
# npm install -g @fsouza/prettierd
format-can-range: true
format-command: >
PATH="./node_modules/.bin:$PATH"
prettierd ${INPUT} ${--range-start=charStart} ${--range-end=charEnd}
${--tab-width=tabSize} ${--use-tabs=!insertSpaces}
format-stdin: true
root-markers:
- .prettierrc
- .prettierrc.json
- .prettierrc.js
- .prettierrc.yml
- .prettierrc.yaml
- .prettierrc.json5
- .prettierrc.mjs
- .prettierrc.cjs
- .prettierrc.toml
proselint: &proselint
# pip install proselint
lint-command: "proselint -"
lint-formats:
- '<stdin>:%l:%c: %m'
lint-source: "proselint"
lint-stdin: true
selene: &selene
lint-command: "selene --display-style quiet -"
lint-formats:
- '%f:%l:%c: %trror%m'
- '%f:%l:%c: %tarning%m'
- '%f:%l:%c: %tote%m'
lint-ignore-exit-code: true
lint-source: "selene"
lint-stdin: true
root-markers:
- selene.toml
shellcheck: &shellcheck
# brew, apt, pacman, yum, etc
lint-command: "shellcheck --color=never --format=gcc -"
lint-source: "shellcheck"
lint-stdin: true
lint-formats:
- '-:%l:%c: %trror: %m'
- '-:%l:%c: %tarning: %m'
- '-:%l:%c: %tote: %m'
shellharden: &shellharden
# cargo install shellharden
format-command: "shellharden --transform ''"
format-stdin: true
shfmt: &shfmt
# go install mvdan.cc/sh/v3/cmd/shfmt@latest
format-command: "shfmt -filename ${INPUT} -"
format-stdin: true
slither: &slither
# pip3 install slither-analyzer
# USAGE:
# * `solc` needs to be manually configured, see:
# https://github.com/foundry-rs/foundry/issues/5429
# https://github.com/crytic/slither/issues/2054
# * `remappings.txt` needs to generated, e.g. `forge remappings > remappings.txt`
lint-category-map:
I: N
O: N
H: E
M: W
L: I
# Parsing JSON without `jq`, backtracking, or lazy matching is cursed,
# but the following is fully POSIX compliant.
# (only POSIX shell syntax and POSIX features of `sed`/`awk`/`printf`)
# Explanation:
# 1. Add ASCII delimiters to mark keywords: https://en.wikipedia.org/wiki/Delimiter#ASCII_delimited_text
# 2. Search through delimiters to format subsections of text. Mark results with different delimiters.
# 3. Pick out the marked results. It'll be the even-numbered fields,
# example: junk|results|junk|results|junk.
# 4. Turn the "lines" result (e.g. "1,2,3,4") into range (e.g. "1-4").
# 5. Change the newline formatting since Neovim doesn't support multi-line messages
lint-command: >
slither --json - "${INPUT}" --solc-remaps "$([ -f remappings.txt ] && tr '\n' ' ' < remappings.txt | xargs)"
| sed "s/filename_absolute/$(printf '%b' '\0036')filename_absolute/g"
| sed "s/lines/$(printf '%b' '\0036')lines/g"
| sed "s/description/$(printf '%b' '\0037')description/g"
| sed "s/impact/$(printf '%b' '\0036')impact/g"
| sed "s/\"elements\"[^$(printf '%b' '\0036')]*\"$(printf '%b' '\0036')filename_absolute\": \"\([^\"]*\)\"[^$(printf '%b' '\0036')]*\"$(printf '%b' '\0036')lines\": \[\([^]]*\)\][^0-9]*starting_column\": \([0-9]*\), \"ending_column\": \([0-9]*\)[^$(printf '%b' '\0037')]*$(printf '%b' '\0037')description\": \"\([^\"]*\)[^$(printf '%b' '\0036')]*\"$(printf '%b' '\0036')impact\": \"\([^\"]*\)\"/$(printf '%b' '\0035')\2| \3-\4 of \1 (\6): \5$(printf '%b' '\0035')/g"
| awk -F "$(printf '%b' '\0035')" '{for (i=2; i<=NF; i+=2) print $i}'
| awk -F "|" '{split($1, a, ", "); $1=a[1] "-" a[length(a)] ":"; print $0}'
| sed 's/\\t-/ |/g'
| sed 's/\\n//g'
| sed 's/\\t//g'
lint-ignore-exit-code: true
lint-formats:
- "%l-%e: %c-%k of %f (%tow): %m"
- "%l-%e: %c-%k of %f (%tedium): %m"
- "%l-%e: %c-%k of %f (%tigh): %m"
- "%l-%e: %c-%k of %f (%tptimization): %m"
- "%l-%e: %c-%k of %f (%tnformational): %m"
lint-source: 'slither'
# Lint won't rerun unless you save, see:
# https://github.com/crytic/slither/issues/2057
lint-stdin: false
root-markers:
- hardhat.config.js
- hardhat.config.ts
- foundry.toml
- remappings.txt
- truffle.js
- truffle-config.js
- ape-config.yaml
solhint: &solhint
# npm install -g solhint
lint-command: >
PATH="./node_modules/.bin:$PATH"
solhint --formatter unix stdin | awk '{ $NF = "(" $NF ")" } 1'
lint-source: 'solhint'
lint-stdin: true
lint-ignore-exit-code: true
lint-formats:
- '%l:%c%*[ ]%trror%*[ ]%m'
- '%l:%c%*[ ]%tarning%*[ ]%m'
- '%f:%l:%c: %m [%trror/%r]'
- '%f:%l:%c: %m [%tarning/%r]'
root-markers:
- .solhint.json
stylua: &stylua
# cargo install stylua
format-can-range: true
format-command: >
stylua ${--indent-width:tabSize} ${--range-start:charStart}
${--range-end:charEnd} --color Never -
format-stdin: true
root-markers:
- 'stylua.toml'
- '.stylua.toml'
yamllint: &yamllint
# pip install yamllint
lint-command: 'yamllint --strict --format parsable -'
lint-source: 'yamllint'
lint-stdin: true
lint-formats:
- '%f:%l:%c: [%t%*[a-z]] %m'
env:
- 'PYTHONIOENCODING=UTF-8'
root-markers:
- '.yamllint'
- '.yamllint.yaml'
- '.yamllint.yml'