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

Enable nolintlint linter #5222

Merged
merged 1 commit into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ linters:
- goheader # Checks is file headers matche a given pattern
- intrange # Checking for loops that could use an integer range
- perfsprint # Checks for faster fmt.Sprintf alternatives
- nolintlint # Find ill-formed or insufficiently explained nolint directives
- revive # Stricter drop-in replacement for golint
- testifylint # Checks usage of github.com/stretchr/testify
- unconvert # Checks for unnecessary type conversions
Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/sysinfo/probes/linux/linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ func newUnameProber() unameProber {
}

func parseUname(utsname *syscall.Utsname) *uname {
convert := func(chars utsStringPtr) unameField {
convert := func(chars *[65]utsChar) unameField {
var buf [65]byte
var i int
for pos, ch := range *chars {
Expand Down
4 changes: 1 addition & 3 deletions internal/pkg/sysinfo/probes/linux/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,4 @@ limitations under the License.

package linux

func utsChar(ch rune) int8 { return int8(ch) } //nolint:deadcode,unused // just for tests 🙄

type utsStringPtr *[65]int8
type utsChar = int8
4 changes: 1 addition & 3 deletions internal/pkg/sysinfo/probes/linux/types_arm.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,4 @@ limitations under the License.

package linux

func utsChar(ch rune) uint8 { return uint8(ch) } //nolint:deadcode,unused // just for tests 🙄

type utsStringPtr *[65]uint8
type utsChar = uint8
1 change: 0 additions & 1 deletion pkg/autopilot/controller/root/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import (
)

// TODO: decide on renaming root.RootConfig -> root.Config
// nolint:revive
type RootConfig struct {
InvocationID string
KubeConfig string
Expand Down
2 changes: 1 addition & 1 deletion pkg/component/controller/workerconfig/reconciler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ func TestReconciler_runReconcileLoop(t *testing.T) {

underTest.runReconcileLoop(ctx, updates, nil)

switch ctx.Err() { //nolint:errorlint // as per context contract
switch ctx.Err() {
case context.Canceled:
break // this is the good case
case context.DeadlineExceeded:
Expand Down
Loading