From 91461f7e0cd98d16babd05fc52c2fc699b2dff97 Mon Sep 17 00:00:00 2001 From: Dan Kortschak Date: Tue, 2 Apr 2019 15:31:04 +1030 Subject: [PATCH] Log stderr output as warning golangci-lint may send informative output on stderr that is helpful for debugging failure. Let the user see this. --- linter.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/linter.py b/linter.py index 52458f3..19fa3dc 100644 --- a/linter.py +++ b/linter.py @@ -41,7 +41,7 @@ class Golangcilint(NodeLinter): # | 1.4565s | gosec | cmd = "golangci-lint run --fast --out-format json" defaults = {"selector": "source.go"} - error_stream = util.STREAM_STDOUT + error_stream = util.STREAM_BOTH line_col_base = (1, 1) def run(self, cmd, code): @@ -128,6 +128,10 @@ def find_errors(self, output): yield self._lintissue(issue) + def on_stderr(self, output): + logger.warning('{} output:\n{}'.format(self.name, output)) + self.notify_failure() + def finalize_cmd(self, cmd, context, at_value='', auto_append=False): """prevents SublimeLinter from appending an unnecessary file""" return cmd