-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Staticcheck ST1003 #649
Comments
I managed to get this working by adding:
|
I think that the initial issue was about enabling back default excludes. |
It supported staticcheck.conf for me! Perhaps this has been fixed in the latest golangci-lint. |
How did you get it to work with config file? |
We just put a staticcheck.conf in our repo-root and ran golangci-lint, and it respected the conf file. I don't remember the details now, unfortunately. |
So we have the following staticcheck.conf file: checks = ["all", "-SA6005", "-SA9003", "-SA4010", "-SA4006"] Here is our .golangci.yml file: run:
deadline: 5m
linters-settings:
gofmt:
simplify: false
govet:
check-shadowing: false
enable:
- unmarshal
- printf
- tests
- bools
- assign
- buildtag
- unreachable
enable-all: false
disable-all: true
linters:
enable:
- gofmt
- govet
- staticcheck
enable-all: false
disable-all: true
fast: false
issues:
max-issues-per-linter: 50
max-same-issues: 10
exclude-rules:
# Exclude some linters from running on tests files.
- path: _test\.go
linters:
- gofmt When we run the following command: golangci-lint run ./... We are seeing entries still for SA6005 and SA4010 so it doesn't seem to respect the staticcheck conf file We tried the following version 1.30 and 1.27: golangci-lint --version
golangci-lint has version 1.30.0 built from 45b90f6 on 2020-08-03T03:10:34Z Is there anything we are doing wrong that you see? |
Not that I can see, but I'm no expert on staticcheck for sure. Our staticcheck.conf file looked like this:
So maybe only |
Sorry for the late reply @csilvers we ended up just doing this: Essentially adding a yaml list per static check to disable, this was the only reliable way to get this working since we couldn't use the staticcheck.conf file reliably. We didn't try initialisms like you proposed although that would be interesting if initialisms is the way over checks. |
More explanation about staticcheck configuration in: #1989 (comment) Closed in favor of #1275 |
Hi,
this is not a bug report.
want to ask regarding the configuration of staticcheck, i.e ST1003 as some check are not enabled by default, i tried to find more info in the documents but to no avail. It doesnt seem to support
staticcheck.conf
Please do let me know how can i configure it
The text was updated successfully, but these errors were encountered: