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

fixbuild: bump linter version #3178

Merged
merged 21 commits into from
Jul 25, 2024
Merged

Conversation

KaloyanTanev
Copy link
Contributor

@KaloyanTanev KaloyanTanev commented Jul 18, 2024

golangci-lint was on older version that did not support go1.22 yet, which causes false alarms.


This update introduced a lot of new, deprecated and modified linters. There are a lot of changes in the files and I would advise for easier review to go over the commits, as I've tried to keep them concise, so there are only changes from one linter or if many, the changes are little. Most eye catching changes in the files are:

  • testifylint: we had quite a lot of assertions inside of go routines, this is a bit of a red flag, because as observed in this small example, a failed assertion might or might not be caught
  • The golangci-lint used in pre-commit was a default golangci-lint from here, using its default config, which made the linter pass locally all the time. This is something I've observed multiple times (dating back to my very first PR :)). Now the pre-commit hook is running the locally installed golangci-lint tool and it checks if the version is the same as the one in the pipelines.
  • Added max-same-issues=0 and max-issues-per-linter=0 so there is no limit on what we see in the output. Previously the default of 3 was used, so if there were hundreds of errors with one linter, it would have displayed only 3, which made it quite a hassle to fix.
  • Bump the golangci-lint action's version to v6. It now points where exactly the issue is, which is great!

category: fixbuild
ticket: #3179

@KaloyanTanev KaloyanTanev self-assigned this Jul 18, 2024
Copy link

codecov bot commented Jul 18, 2024

Codecov Report

Attention: Patch coverage is 61.35831% with 165 lines in your changes missing coverage. Please review.

Project coverage is 57.86%. Comparing base (13ac05a) to head (a8a88d8).

Files Patch % Lines
app/app.go 0.00% 19 Missing ⚠️
core/priority/component.go 0.00% 17 Missing ⚠️
cluster/manifest/mutationaddvalidator.go 23.52% 0 Missing and 13 partials ⚠️
cluster/manifest/helpers.go 21.42% 0 Missing and 11 partials ⚠️
core/proto.go 44.44% 1 Missing and 9 partials ⚠️
cluster/manifest/mutationnodeapproval.go 27.27% 0 Missing and 8 partials ⚠️
core/consensus/msg.go 50.00% 6 Missing and 2 partials ⚠️
app/health/select.go 75.00% 5 Missing and 1 partial ⚠️
cluster/manifest/cluster.go 50.00% 4 Missing and 1 partial ⚠️
cluster/manifest/mutationlegacylock.go 0.00% 0 Missing and 5 partials ⚠️
... and 35 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3178      +/-   ##
==========================================
+ Coverage   56.78%   57.86%   +1.07%     
==========================================
  Files         208      208              
  Lines       29235    29217      -18     
==========================================
+ Hits        16601    16906     +305     
+ Misses      10809    10483     -326     
- Partials     1825     1828       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Fix previously uncaught by linter revive linters

Fix all other revive linters

Fix previously uncaught by linter revive linters

Fix previously uncaught by linter revive linters round 2

Fix previously uncaught by linter revive linters round 2

Fix previously uncaught by linter revive linters round 3
Update for loops over integers with range round 2

Update for loops over integers with range round 3

Update for loops over integers with range round 4
Fix perfsprint linter round 2

Fix perfsprint linter round 2

Fix perfsprint linter round 3

Fix perfsprint linter round 4
@KaloyanTanev KaloyanTanev force-pushed the kalo/bump-golangci-lint-v1.59.1 branch 2 times, most recently from cd61973 to 32d405e Compare July 21, 2024 18:48
@KaloyanTanev KaloyanTanev force-pushed the kalo/bump-golangci-lint-v1.59.1 branch from 32d405e to 28840e8 Compare July 21, 2024 20:22
Copy link

sonarcloud bot commented Jul 21, 2024

@KaloyanTanev KaloyanTanev added the merge when ready Indicates bulldozer bot may merge when all checks pass label Jul 25, 2024
@obol-bulldozer obol-bulldozer bot merged commit 54846a0 into main Jul 25, 2024
20 checks passed
@obol-bulldozer obol-bulldozer bot deleted the kalo/bump-golangci-lint-v1.59.1 branch July 25, 2024 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge when ready Indicates bulldozer bot may merge when all checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants