From b086c2c730b41a4b93d525cc3b94026e9a29164f Mon Sep 17 00:00:00 2001 From: herr kaste Date: Thu, 15 Mar 2018 11:20:22 +0100 Subject: [PATCH] Fixup for SublimeLinter 4 Notable: Must ensure that cmd[0] as returned by `cmd()` is never 'falsy'. --- linter.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/linter.py b/linter.py index 5e884bb..2273cb4 100644 --- a/linter.py +++ b/linter.py @@ -18,18 +18,12 @@ class HtmlTidy(Linter): """Provides an interface to tidy.""" syntax = 'html' - executable = 'tidy' - version_args = '--version' - version_re = r'(?P\d+\.\d+\.\d+)' - version_requirement = '>= 4.9' regex = r'^line (?P\d+) column (?P\d+) - (?:(?PError)|(?PWarning)): (?P.+)' error_stream = util.STREAM_STDERR def cmd(self): """Return a tuple with the command line to execute.""" - command = [self.executable_path, '-errors', '-quiet', '-utf8'] - if Linter.which('tidy5'): - command[0] = Linter.which('tidy5') - else: - command[0] = Linter.which('tidy') - return command + # Must return either a full path to a binary or an informal name + # of an executable. + executable = self.which('tidy5') or 'tidy' + return [executable, '-errors', '-quiet', '-utf8']