-
Notifications
You must be signed in to change notification settings - Fork 8
Add support for golangci-lint version 2 #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 3.8 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,10 @@ | |
|
|
||
|
|
||
| class GolangCILint(Linter): | ||
| cmd = 'golangci-lint run ${args} --out-format tab ${file_path}' | ||
| def cmd(self): | ||
| if self.settings.get("v1", False): | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @kaste This is still too magical. Do we need to run
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right now, that would be just a manual setting. We would need to add that to the README and then the release notes. Of course it would be possible to automate this, let me sketch that out. Let's see if I get that just out of my head: import shutil
from SublimeLinter.lint import util
# first resolve the executable
if binary:= shutil.which("golangci"):
stdout: str = util.check_output([binary, "<whatever arg it takes to return the version>"])
# parse stdout with a regex or simpler if stdout.startswith("1.")
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @kaste Thanks! It occurred to me only later that we were creating a new setting. I actually like the idea of making it just a setting. Very light weight and robust. I've pushed up some more changes. What do you think now?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. LGTM 😄 |
||
| return 'golangci-lint run ${args} --out-format tab ${file_path}' | ||
| return 'golangci-lint run ${args} --output.tab.path stdout ${file_path}' | ||
| tempfile_suffix = '-' | ||
| # Column reporting is optional and not provided by all linters. | ||
| # Issues reported by the 'typecheck' linter are treated as errors, | ||
|
|
@@ -13,5 +16,4 @@ class GolangCILint(Linter): | |
| default_type = WARNING | ||
| defaults = { | ||
| 'selector': 'source.go', | ||
| 'args': '--fast' | ||
kaste marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.