Skip to content
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

update staticcheck to v2020.1.3 #987

Merged
merged 1 commit into from
Mar 12, 2020

Conversation

thaJeztah
Copy link
Contributor

full diff: dominikh/go-tools@2019.2.3...2020.1.3

Also updates tests to accomodate updated rules:

    --- FAIL: TestSourcesFromTestdataWithIssuesDir/staticcheck.go (0.43s)
            linters_test.go:137: [run --disable-all --print-issued-lines=false --print-linter-name=false --out-format=line-number --max-same-issues=10 -Estaticcheck --no-config testdata/staticcheck.go]
            linters_test.go:33:
                    Error Trace:    linters_test.go:33
                                                linters_test.go:138
                                                linters_test.go:53
                    Error:          Received unexpected error:

                                    staticcheck.go:11: no match for `self-assignment of x to x` vs ["SA4006: this value of `x` is never used"] in:
                                        staticcheck.go:11:2: SA4006: this value of `x` is never used
                                    unmatched errors
                                    staticcheck.go:11:2: SA4006: this value of `x` is never used
                    Test:           TestSourcesFromTestdataWithIssuesDir/staticcheck.go

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah force-pushed the update_staticcheck branch from a24fc23 to bf27481 Compare March 10, 2020 13:55
@ernado ernado merged commit 2c4ef2b into golangci:master Mar 12, 2020
@thaJeztah thaJeztah deleted the update_staticcheck branch March 12, 2020 17:29
@thaJeztah
Copy link
Contributor Author

Thanks!

@ksoichiro
Copy link
Contributor

It's great that staticcheck was updated!
But unfortunately it seems unused linter is broken after this change...
Some false positives are detected in our private repo.
I'll check later and share minimal reproducible codes.

@ernado
Copy link
Member

ernado commented Mar 13, 2020

Hey @ksoichiro, new version was not released. Are you building golangci by yourself?

@ksoichiro
Copy link
Contributor

Thank you for your response @ernado.
Yes, I know that.
We detected it because our repo is not properly configured, and golangci-lint was built on our CI.
We've already fixed our CI to get the latest tagged version,
but I commented to share it because I think it would be an issue if you release the current master branch.

@ernado
Copy link
Member

ernado commented Mar 13, 2020

Thank you, @ksoichiro, I've just wanted to double-check.

Will wait until a way to reproduce that problem, so we can debug and fix that issue before releasing new version.

@ksoichiro
Copy link
Contributor

I found that it was not false positive, it was really unused!
It was a variable in our test code, which was not reachable because it was marked as skip: runtime.Goexit() was called there.
It seems newer version of staticcheck is aware of runtime.Goexit().
I'm really sorry for bothering you, but I hope this helps someone.

@ernado
Copy link
Member

ernado commented Mar 13, 2020

Thank you very much, @ksoichiro!

I'm really sorry for bothering you

No worries, I am very grateful for your help.

@thaJeztah
Copy link
Contributor Author

Good to hear, thanks!

ernado added a commit that referenced this pull request Apr 22, 2020
Hotfix for `failed prerequisites` errors.
Actual cause is still unknown.

Revert: #987
Ref: #994, #995, #1011
@ernado
Copy link
Member

ernado commented Apr 22, 2020

I have no idea why staticcheck update is causing those issues, but I had to revert it, sorry.

@thaJeztah
Copy link
Contributor Author

I saw it yes. That's unfortunate; hope you're able to find what causes it

jirfag added a commit that referenced this pull request May 3, 2020
The primary improvement is in early clearing of
analyzed package's TypeInfo, facts, etc for
whole program analyzers (`unused`). Clear it when it
becomes unused and GC collects them early. Initially this
clearing was performed for all analyzers except `unused`.

Update staticcheck from v0.0.1-2019.2.3 to v0.0.1-2020.1.4

Also in this commit:
  * speed up loading packages from export data (2.5s -> 2.1s for std)
    by not using mutex for export data since it was allowed in
    x/tools#07722704da13
  * make an order of execution of linters stable
  * update renameio and robustio
  * use robustio in caching

Relates: #987, #994, #995, #1011
@jirfag
Copy link
Contributor

jirfag commented May 3, 2020

Updating staticcheck back in #1063

@thaJeztah
Copy link
Contributor Author

Thanks for keeping me updated!

jirfag added a commit that referenced this pull request May 3, 2020
The primary improvement is in early clearing of
analyzed package's TypeInfo, facts, etc for
whole program analyzers (`unused`). Clear it when it
becomes unused and GC collects them early. Initially this
clearing was performed for all analyzers except `unused`.

Update staticcheck from v0.0.1-2019.2.3 to v0.0.1-2020.1.4

Also in this commit:
  * speed up loading packages from export data (2.5s -> 2.1s for std)
    by not using mutex for export data since it was allowed in
    x/tools#07722704da13
  * make an order of execution of linters stable
  * update renameio and robustio
  * use robustio in caching

Relates: #987, #994, #995, #1011
jirfag added a commit that referenced this pull request May 3, 2020
The primary improvement is in early clearing of
analyzed package's TypeInfo, facts, etc for
whole program analyzers (`unused`). Clear it when it
becomes unused and GC collects them early. Initially this
clearing was performed for all analyzers except `unused`.

Update staticcheck from v0.0.1-2019.2.3 to v0.0.1-2020.1.4

Also in this commit:
  * speed up loading packages from export data (2.5s -> 2.1s for std)
    by not using mutex for export data since it was allowed in
    x/tools#07722704da13
  * make an order of execution of linters stable
  * update renameio and robustio
  * use robustio in caching

Relates: #987, #994, #995, #1011
jirfag added a commit that referenced this pull request May 5, 2020
The primary improvement is in early clearing of
analyzed package's TypeInfo, facts, etc for
whole program analyzers (`unused`). Clear it when it
becomes unused and GC collects them early. Initially this
clearing was performed for all analyzers except `unused`.

Update staticcheck from v0.0.1-2019.2.3 to v0.0.1-2020.1.4

Also in this commit:
  * speed up loading packages from export data (2.5s -> 2.1s for std)
    by not using mutex for export data since it was allowed in
    x/tools#07722704da13
  * make an order of execution of linters stable
  * update renameio and robustio
  * use robustio in caching

Relates: #987, #994, #995, #1011
@ldez ldez added the linter: update version Update version of linter label Dec 7, 2020
@ldez ldez added this to the v1.24 milestone Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
linter: update version Update version of linter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants