Skip to content

Instantly share code, notes, and snippets.

Created May 12, 2016 20:01
What would you like to do?
scss-lint with SublimeLinter in ST2
import re
from base_linter import BaseLinter
'language': 'SCSS',
'executable': '',
'lint_args': '{filename}'
class Linter(BaseLinter):
def parse_errors(self, view, errors, lines, errorUnderlines, violationUnderlines, warningUnderlines, errorMessages, violationMessages, warningMessages):
for line in errors.splitlines():
match = re.match(r'^.+:(?P<line>\d+)\s\[(?P<type>W)\]\s(?P<error>.+)', line)
if match:
error_type, error, line ='type'),'error'),'line')
line = int(line)
error = '[{0}] {1}'.format(error_type[0].upper(), error)
if error_type == 'W':
messages = warningMessages
underlines = warningUnderlines
messages = errorMessages
underlines = errorUnderlines
self.add_message(line, lines, error, messages)
self.underline_range(view, line, 0, underlines)
#!/usr/bin/env bash
echo $(scss-lint -c ~/.scss-lint.yml $*)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment