Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion linter.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,23 @@ class Ruby(RubyLinter):
syntax = ('ruby', 'ruby on rails', 'rspec')
cmd = 'ruby -wc'
regex = (
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'
r'(?:^[^\r\n]+\r?\n^(?P<col>.*?)\^)?'
)
multiline = True
comment_re = r'\s*#'

def split_match(self, match):
"""
Return the components of the match.

We override this because unrelated library files can throw errors,
and we only want errors from the linted file.

"""

if match:
if match.group('file') != '-':
match = None

return super().split_match(match)