-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Differentiate between errors and warnings in VSCode #2302
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
Comments
I love this topic, but always find excuses to procrastinate my research on it. So here are a few things about severity:
This is what we have in severity comment:
now let's play with a code? (everybody like examples)?
linters:
disable-all: true
enable:
- revive
- lll
- makezero
- dogsled
# all available settings of specific linters
linters-settings:
dogsled:
max-blank-identifiers: 1
makezero:
always: true
lll:
line-length: 40
revive:
ignore-generated-header: true
confidence: 0.5
severity: warning
rules:
- name: atomic
severity: info
severity:
default-severity: error
case-sensitive: false
rules:
- linters:
- lll
severity: info
- linters:
- dogsled
severity: error
- linters:
- makezero
severity: warn
if you run this with golangci-lint run --out-format json | jq '.Issues[] | {text: .Text, severity: .Severity }' you will get something like {
"text": "declaration has 2 blank identifiers",
"severity": "error"
}
{
"text": "line is 58 characters",
"severity": "info"
}
{
"text": "slice `_` does not have non-zero initial length",
"severity": "warn"
}
{
"text": "atomic: direct assignment to atomic value",
"severity": "error"
} So how does vscode-go consume linter warnings? this is how Let's read this together:
So.. This is how I think we need to go to P.S. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This article indicates VSCode already supports linter error levels:
|
Your feature request related to a problem? Please describe.
I can set the
severity
in golangci-lint's config toerror
orwarning
and vscode displays the linting the same way, seemingly as a warning.I'd like to be able to separate out style suggestions from linting errors that indicate bugs... which is what severity is for, but I'm not sure it's getting output in the right format for vscode to understand.
Describe the solution you'd like.
I believe there's a way to format the output so that vscode can differentiate between errors and warnings.
Describe alternatives you've considered.
I don't know that there is an alternative.
Additional context.
No response
The text was updated successfully, but these errors were encountered: