forked from liquidev/lintplus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshellcheck.lua
42 lines (36 loc) · 981 Bytes
/
shellcheck.lua
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
-- shellcheck plugin for lint+
--- INSTALLATION ---
-- In order to use this linter, please ensure you have the shellcheck binary
-- in your path. For installation notes please see
-- https://github.com/koalaman/shellcheck#user-content-installing
--- CONFIG ---
-- config.lint.shellcheck_args: table[string]
-- passes the given arguments to shellcheck.
--- IMPLEMENTATION ---
local lintplus = require "plugins.lintplus"
lintplus.add("shellcheck") {
filename = "%.sh$",
syntax = {
"Shell script",
"shellscript",
"bashscript",
"Bash script",
"Bash",
"bash",
},
procedure = {
command = lintplus.args_command(
{ "shellcheck",
"--format=gcc",
lintplus.args,
lintplus.filename
},
"shellcheck_args"
),
interpreter = lintplus.interpreter {
info = "(.*):(%d+):(%d+): note: (.+)",
error = "(.*):(%d+):(%d+): error: (.+)",
warning = "(.*):(%d+):(%d+): warning: (.+)",
}
},
}