We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 969c0ce + bca8cc2 commit 5cdf750Copy full SHA for 5cdf750
1 file changed
linter.py
@@ -20,8 +20,23 @@ class Ruby(RubyLinter):
20
syntax = ('ruby', 'ruby on rails', 'rspec')
21
cmd = 'ruby -wc'
22
regex = (
23
- r'^.+?:(?P<line>\d+): (?:(?P<error>.*?error)|(?P<warning>warning))[,:] (?P<message>[^\r\n]+)\r?\n'
+ r'^(?P<file>.+?):(?P<line>\d+): (?:(?P<error>.*?error)|(?P<warning>warning))[,:] (?P<message>[^\r\n]+)\r?\n'
24
r'(?:^[^\r\n]+\r?\n^(?P<col>.*?)\^)?'
25
)
26
multiline = True
27
comment_re = r'\s*#'
28
+
29
+ def split_match(self, match):
30
+ """
31
+ Return the components of the match.
32
33
+ We override this because unrelated library files can throw errors,
34
+ and we only want errors from the linted file.
35
36
37
38
+ if match:
39
+ if match.group('file') != '-':
40
+ match = None
41
42
+ return super().split_match(match)
0 commit comments