Skip to content

Commit 8de40c1

Browse files
committed
Fix output parser when golangci-lint errors in /dev/stderr
When a GOROOT file like `GOROOT/src/time/time.go` is analyzed, the linter errors because some linters like “nolint” are unable to create the AST cache. The errors are sent to /dev/stderr in non-JSON format which makes it impossible for the SublimeLinter plugin to parse. Because of this, I have opted to silence these warnings.
1 parent 9b8959e commit 8de40c1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

linter.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import json
33
import logging
44
import tempfile
5-
from SublimeLinter.lint import NodeLinter
5+
from SublimeLinter.lint import NodeLinter, util
66
from SublimeLinter.lint.linter import LintMatch
77
from SublimeLinter.lint.persist import settings
88

@@ -41,6 +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
4445
line_col_base = (1, 1)
4546

4647
def run(self, cmd, code):

0 commit comments

Comments
 (0)