-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlinter.py
47 lines (38 loc) · 1.16 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
41
42
43
44
45
46
47
#
# linter.py
# Linter for SublimeLinter4, a code checking framework for Sublime Text 3
#
# Written by Michał Sochoń
# Copyright (c) 2017 Michał Sochoń
#
# License: MIT
#
"""This module exports the AnsibleReview plugin class."""
from SublimeLinter.lint import Linter, util
import logging
logger = logging.getLogger('SublimeLinter.plugin.ansbile-review')
class AnsibleReview(Linter):
"""Provides an interface to ansible-review."""
# ansbile-lint verison requirements check
version_args = '--version'
version_re = r'(?P<version>\d+\.\d+\.\d+)'
version_requirement = '>= 0.13.4'
# linter settings
cmd = ('ansible-review', '${file}')
regex = r'^.+:(?P<line>\d+): \[(?P<error>.+)\] (?P<message>.+)'
# -p generate non-multi-line, pep8 compatible output
multiline = False
# ansible-lint does not support column number
word_re = False
line_col_base = (1, 1)
tempfile_suffix = 'yml'
error_stream = util.STREAM_STDOUT
defaults = {
'selector': 'source.ansible',
'args': '', # '-v -q'
'-c': '',
'-d': '',
'-r': '',
'-s': '',
}
inline_overrides = ['c', 'd', 'r', 's']