Skip to content

Commit 05607a6

Browse files
committed
Add additional comments, fix any pep8 errors.
1 parent 51a8f42 commit 05607a6

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

linter.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ class Htmlhint(Linter):
2828
tempfile_suffix = '-'
2929
config_file = ('--config', '.htmlhintrc', '~')
3030

31+
# htmlhint uses color codes to distinguish errors and warnings
32+
# colors get stripped by sublimelinter
33+
# match warnings instead
3134
warn_regex = (
3235
r'^(Doctype must be html5.'
3336
r'|The script tag can not be used in head'
@@ -40,14 +43,15 @@ class Htmlhint(Linter):
4043
)
4144
warn_re = re.compile(warn_regex)
4245

43-
def split_match(self, match):
46+
def split_match(self, match):
4447
split = super().split_match(match)
4548
if match:
4649
message = match.group('message')
47-
50+
51+
# check if message is a warning
4852
warn = self.warn_re.match(message)
4953
if warn:
5054
split = (split[0], split[1], split[2], False, True, split[5], split[6])
51-
55+
5256
persist.debug('match -- msg:"{}", split:"{}", warn: {}'.format(message, split, warn))
5357
return split

0 commit comments

Comments
 (0)