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

[fix] golangci-lint is unlocked to use the latest version again #489

Merged
merged 5 commits into from
Aug 29, 2024

Conversation

unnatiagg
Copy link
Contributor

What this PR does / why we need it:
golangci-lint was locked to use v1.59.1 in this PR #455.
It is switched back to use the latest verison and all the lint updates are taken care of.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #
The breaking upgrade that golangci-lint latest brought in was mandating passing of format strings for Printf and similar functions.
For example:
Printf and similar functions are usually called with a literal format string, followed by zero or more arguments.
Even though Printf(v) is accepted, it is not the best way. This format string will fail if v string has unexpected percent sign.

Function calls have been modified to look like: conditions.MarkFalse(machineScope.LinodeMachine, ConditionPreflightRootDiskResized, string(cerrs.CreateMachineError), clusterv1.ConditionSeverityWarning, "%s", err.Error())

This is better way to handle all types of cases where the intended use was a literal format string. Printf("%s", v).

Other updates are pretty self explanatory.

Special notes for your reviewer:

TODOs:

  • squashed commits
  • includes documentation
  • adds unit tests
  • adds or updates e2e tests

Copy link

codecov bot commented Aug 29, 2024

Codecov Report

Attention: Patch coverage is 75.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 64.96%. Comparing base (c6d8807) to head (66d85e9).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
controller/linodemachine_controller_helpers.go 25.00% 3 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #489   +/-   ##
=======================================
  Coverage   64.95%   64.96%           
=======================================
  Files          77       77           
  Lines        3978     3979    +1     
=======================================
+ Hits         2584     2585    +1     
  Misses       1164     1164           
  Partials      230      230           

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

.golangci.yml Show resolved Hide resolved
controller/linodefirewall_controller.go Show resolved Hide resolved
@unnatiagg unnatiagg merged commit ec4db61 into main Aug 29, 2024
13 checks passed
@eljohnson92 eljohnson92 deleted the govet-latest branch September 20, 2024 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants