File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -20,8 +20,23 @@ class Ruby(RubyLinter):
2020 syntax = ('ruby' , 'ruby on rails' , 'rspec' )
2121 cmd = 'ruby -wc'
2222 regex = (
23- r'^.+?:(?P<line>\d+): (?:(?P<error>.*?error)|(?P<warning>warning))[,:] (?P<message>[^\r\n]+)\r?\n'
23+ r'^(?P<file> .+?) :(?P<line>\d+): (?:(?P<error>.*?error)|(?P<warning>warning))[,:] (?P<message>[^\r\n]+)\r?\n'
2424 r'(?:^[^\r\n]+\r?\n^(?P<col>.*?)\^)?'
2525 )
2626 multiline = True
2727 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 )
You can’t perform that action at this time.
0 commit comments