-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathlinter.py
37 lines (29 loc) · 910 Bytes
/
linter.py
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
from SublimeLinter.lint import Linter, util
class Javac(Linter):
regex = (
r'^(?P<filename>.+?):(?P<line>\d+): '
r'(?:(?P<error>error)|(?P<warning>warning)): '
r'(?:\[.+?\] )?(?P<message>[^\r\n]+)\r?\n'
r'[^\r\n]+\r?\n'
r'(?P<col>[^\^]*)\^'
)
multiline = True
tempfile_suffix = '-'
error_stream = util.STREAM_STDERR
defaults = {
'lint': '',
'-classpath::': [],
'selector': 'source.java'
}
def cmd(self):
"""
Return the command line to execute.
We override this because we have to munge the -Xlint argument
based on the 'lint' setting.
"""
xlint = '-Xlint'
settings = self.get_view_settings()
options = settings.get('lint')
if options:
xlint += ':' + options
return ('javac', xlint, '-encoding', 'UTF8', '${args}')