-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathlinter.py
31 lines (23 loc) · 901 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
from SublimeLinter.lint import Linter
class RubyLinter(Linter):
def context_sensitive_executable_path(self, cmd):
# The default implementation will look for a user defined `executable`
# setting.
success, executable = super().context_sensitive_executable_path(cmd)
if success:
return True, executable
gem_name = cmd[0] if isinstance(cmd, list) else cmd
if self.settings.get('use_bundle_exec', False):
return True, ['bundle', 'exec', gem_name]
rvm = self.which('rvm-auto-ruby')
if rvm:
return True, [rvm, '-S', gem_name]
return False, None
class Mdl(RubyLinter):
cmd = ['mdl', '${temp_file}']
regex = r'^.+?:(?P<line>\d+): (?P<warning>(?P<message>[^`]*))'
line_col_base = (1, 1)
tempfile_suffix = 'md'
defaults = {
'selector': 'text.html.markdown'
}