-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathlinter.py
32 lines (27 loc) · 870 Bytes
/
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
#
# linter.py
# Markdown Linter for SublimeLinter, a code checking framework
# for Sublime Text 3
#
# Written by Jon LaBelle
# Copyright (c) 2018 Jon LaBelle
#
# License: MIT
#
"""This module exports the Markdownlint plugin class."""
from SublimeLinter.lint import NodeLinter, util
class MarkdownLint(NodeLinter):
"""Provides an interface to markdownlint."""
defaults = {
'selector': 'text.html.markdown,'
'text.html.markdown.multimarkdown,'
'text.html.markdown.extended,'
'text.html.markdown.gfm'
}
cmd = ('markdownlint', '${args}', '${temp_file}')
regex = r'.+?(?:[:](?P<line>\d+))(?:[:](?P<col>\d+))?\s+(?P<error>MD\d+)?[/]?(?P<message>.+)'
multiline = False
line_col_base = (1, 1)
tempfile_suffix = 'md'
error_stream = util.STREAM_STDERR
word_re = None