1
0
Fork 0
mirror of https://github.com/Reuh/SublimeLinter-contrib-cancheck.git synced 2025-10-27 12:19:30 +00:00

Initial commit

This commit is contained in:
Étienne Fildadut 2020-04-07 00:02:43 +02:00
commit 35508499f5
8 changed files with 147 additions and 0 deletions

22
linter.py Executable file
View file

@ -0,0 +1,22 @@
# Taken from https://github.com/SublimeLinter/SublimeLinter-luacheck
from SublimeLinter.lint import Linter
class Luacheck(Linter):
cmd = 'cancheck - --formatter=plain --codes --ranges --filename ${file}'
regex = (
r'^.+:(?P<line>\d+):(?P<col>\d+)\-(?P<col_end>\d+): '
r'\((?:(?P<error>E\d+)|(?P<warning>W\d+))\) '
r'(?P<message>.+)'
)
defaults = {
'selector': 'source.candran'
}
def split_match(self, match):
"""Patch regex matches to highlight token correctly."""
match, line, col, error, warning, msg, _ = super().split_match(match)
col_end = int(match.group(3))
token_len = col_end - col
return match, line, col, error, warning, msg, "." * token_len