Skip to content

Supports analysis package error format in golangci-lint test #1222

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

Closed
sonatard opened this issue Jul 9, 2020 · 2 comments · Fixed by #3104
Closed

Supports analysis package error format in golangci-lint test #1222

sonatard opened this issue Jul 9, 2020 · 2 comments · Fixed by #3104
Labels
enhancement New feature or improvement

Comments

@sonatard
Copy link
Contributor

sonatard commented Jul 9, 2020

In order to add a linter to golangci-lint, we need to add tests. However, the error format is different between the analysistest package and golangci-lint, so we have to change it. If same error format, we can reuse the test cases by simply copying test files.

golangci-lint test error format

http.Get(url) // ERROR "net/http.Get must not be called"

http.Get(url) // ERROR "net/http\.Get must not be called"

analysistest package error format

http.Get(url) // want net/http\.Get must not be called
https://github.com/sonatard/noctx/blob/cca218322853bcbd277bf1ff37ec43b473a885dc/testdata/src/a/a.go#L15

https://godoc.org/golang.org/x/tools/go/analysis/analysistest#Run

Is there any reason for the different error formats?

@sonatard sonatard added the enhancement New feature or improvement label Jul 9, 2020
@sayboras sayboras changed the title Supports analysis package error format in golagnci-lint test Supports analysis package error format in golangci-lint test Jul 10, 2020
@stale
Copy link

stale bot commented Jul 11, 2021

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.

@stale stale bot added the stale No recent correspondence or work activity label Jul 11, 2021
@ldez ldez removed the stale No recent correspondence or work activity label Jul 11, 2021
@stale
Copy link

stale bot commented Aug 13, 2022

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.

@stale stale bot added the stale No recent correspondence or work activity label Aug 13, 2022
@ldez ldez removed the stale No recent correspondence or work activity label Aug 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improvement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants