Skip to content

Commit 91461f7

Browse files
committed
Log stderr output as warning
golangci-lint may send informative output on stderr that is helpful for debugging failure. Let the user see this.
1 parent d8d7ae9 commit 91461f7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

linter.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class Golangcilint(NodeLinter):
4141
# | 1.4565s | gosec |
4242
cmd = "golangci-lint run --fast --out-format json"
4343
defaults = {"selector": "source.go"}
44-
error_stream = util.STREAM_STDOUT
44+
error_stream = util.STREAM_BOTH
4545
line_col_base = (1, 1)
4646

4747
def run(self, cmd, code):
@@ -128,6 +128,10 @@ def find_errors(self, output):
128128

129129
yield self._lintissue(issue)
130130

131+
def on_stderr(self, output):
132+
logger.warning('{} output:\n{}'.format(self.name, output))
133+
self.notify_failure()
134+
131135
def finalize_cmd(self, cmd, context, at_value='', auto_append=False):
132136
"""prevents SublimeLinter from appending an unnecessary file"""
133137
return cmd

0 commit comments

Comments
 (0)