# Taken from https://github.com/SublimeLinter/SublimeLinter-luacheck from SublimeLinter.lint import Linter class Cancheck(Linter): cmd = 'cancheck - --formatter=plain --codes --ranges --filename ${file}' regex = ( r'^.+:(?P\d+):(?P\d+)\-(?P\d+): ' r'\((?:(?PE\d+)|(?PW\d+))\) ' r'(?P.+)' ) 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