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

The golangcilint linter of perfsprint is not working as expected #14214

Closed
gotjosh opened this issue Jun 5, 2024 · 7 comments
Closed

The golangcilint linter of perfsprint is not working as expected #14214

gotjosh opened this issue Jun 5, 2024 · 7 comments

Comments

@gotjosh
Copy link
Member

gotjosh commented Jun 5, 2024

What did you do?

I noticed that this particular line should have been caught by the linter and failed: https://github.com/prometheus/prometheus/blob/main/rules/manager_test.go#L198 (there are more examples)

@gotjosh
Copy link
Member Author

gotjosh commented Jun 5, 2024

It seems like with the upgrade of golangcilint some of the linter don't work (or work?) as expected. You can see an example of it here: #14215

@aknuds1 should we rollback #14153 until we figure it out?

@aknuds1
Copy link
Contributor

aknuds1 commented Jun 5, 2024

Why does a performance linter matter for test files?

@gotjosh
Copy link
Member Author

gotjosh commented Jun 5, 2024

Why does a performance linter matter for test files?

It doesn't - but it's not the way it worked in the previous version thus can be considered a breaking change?

@gotjosh
Copy link
Member Author

gotjosh commented Jun 5, 2024

When perfsprint was originally introduced it linted all of the test files too: #14091 - with the upgrade of golangcilint it stopped.

So at the very minimum, it is now inconsistent.

@aknuds1
Copy link
Contributor

aknuds1 commented Jun 5, 2024

I noticed that this particular line should have been caught by the linter and failed: https://github.com/prometheus/prometheus/blob/main/rules/manager_test.go#L198

It's not a regression. That line is not caught because of a perfsprint exclusion in .golangci.yml. That exclusion had to be updated for v1.59.0. That's why you see more things getting caught when downgrading.

@gotjosh
Copy link
Member Author

gotjosh commented Jun 5, 2024

🤦 so this is actually text-based exclusion in golangcilint TIL.

This comment from Björn makes all the sense in the world: #14091 (comment)

@gotjosh
Copy link
Member Author

gotjosh commented Jun 5, 2024

Thanks for the clarification 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants