Skip to content

Commit

Permalink
Merge pull request #11 from SublimeLinter/error-rules
Browse files Browse the repository at this point in the history
return the rule seperately
  • Loading branch information
braver authored Mar 7, 2019
2 parents a93fbc2 + b9d9171 commit 33a46a4
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions linter.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import re
import logging
from SublimeLinter.lint import NodeLinter
from SublimeLinter.lint.linter import LintMatch

logger = logging.getLogger('SublimeLinter.plugin.stylelint')

Expand Down Expand Up @@ -62,10 +63,14 @@ def find_errors(self, output):
for warning in data['warnings']:
line = warning['line'] - self.line_col_base[0]
col = warning['column'] - self.line_col_base[1]
type = warning['severity']
text = warning['text']
text = warning['text'].replace('(' + warning['rule'] + ')', '')
text = text.rstrip()

if type == 'warning':
yield (warning, line, col, "", type, text, None)
else:
yield (warning, line, col, type, "", text, None)
yield LintMatch(
match=warning,
line=line,
col=col,
error_type=warning['severity'],
code=warning['rule'],
message=text
)

0 comments on commit 33a46a4

Please sign in to comment.