forked from attenzione/SublimeLinter-scss-lint
-
Notifications
You must be signed in to change notification settings - Fork 0
/
linter.py
40 lines (29 loc) · 1.02 KB
/
linter.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Sergey Margaritov
# Copyright (c) 2013 Sergey Margaritov
#
# License: MIT
#
"""This module exports the scss-lint plugin linter class."""
import os
from SublimeLinter.lint import Linter, util
class Scss(Linter):
"""Provides an interface to the scss-lint executable."""
syntax = ('sass', 'scss')
executable = 'scss-lint'
regex = r'^.+?:(?P<line>\d+) (?:(?P<error>\[E\])|(?P<warning>\[W\])) (?P<message>.+)'
# cmd = 'scss-lint'
def cmd(self):
"""
Return a string with the command line to execute.
We define this method because we want to use the .scsslintrc files,
and we can't rely on scss-lint to find them, because we are using stdin.
"""
command = [self.executable_path]
scsslintrc = util.find_file(os.path.dirname(self.filename), '.scss-lint.yml')
if scsslintrc:
command += ['--config', scsslintrc]
return command + ['@']