-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathlinter.py
More file actions
47 lines (39 loc) · 1.28 KB
/
Copy pathlinter.py
File metadata and controls
47 lines (39 loc) · 1.28 KB
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
from SublimeLinter.lint import Linter, util
CMD = (
"cppcheck",
"--template={file}:{line}:{column}:{severity}:{id}:{message}",
"--inline-suppr",
"--quiet",
"${args}",
"${file}",
)
REGEX = (
r"^(?P<filename>(:\\|[^:])+):(?P<line>\d+):((?P<col>\d+):)"
r"((?P<error>error)|(?P<warning>warning|style|performance|portability|information)):"
r"(?P<code>\w+):(?P<message>.+)"
)
class Cppcheck(Linter):
cmd = CMD
regex = REGEX
error_stream = util.STREAM_BOTH # linting errors are on stderr, exceptions like "file not found" on stdout
on_stderr = None # handle stderr via split_match
tempfile_suffix = "-"
defaults = {
"selector": "source.c",
"--language=": "c",
"--std=,+": [], # example ['c89', 'c99', 'c11']
"--enable=,": "style",
}
class CppcheckPlus(Linter):
cmd = CMD
regex = REGEX
error_stream = util.STREAM_BOTH # linting errors are on stderr, exceptions like "file not found" on stdout
on_stderr = None # handle stderr via split_match
tempfile_suffix = "-"
name = 'cppcheck++'
defaults = {
"selector": "source.c++",
"--language=": "c++",
"--std=,+": [], # example ['c++03', 'c++11', 'c++14', 'c++17', 'c++20']
"--enable=,": "style",
}