openshift / kube-compare

A Kubectl plugin to allow to compare a known valid reference configuration and a set of specific cluster configuration CRs.
Apache License 2.0
8 stars 8 forks source link

Linting as a blocker for merge. #22

Closed nocturnalastro closed 1 week ago

nocturnalastro commented 3 weeks ago

Found some cases of errors not being handled or dropped. I suggest we add golangci-lint or some other linter as a blocker on merges to act as a guard against such things happening.

nocturnalastro commented 3 weeks ago

I made a draft PR addressing the issues raised by running a default config of golangci-lint here: https://github.com/openshift/kube-compare/pull/23

crwr45 commented 3 weeks ago

+1, I have had good value from linting in the past. It's not a silver bullet for anything but I've seen had golangci-lint highlight genuine bugs, and improve runtime efficiency.

nocturnalastro commented 3 weeks ago

It spotted a shadowed definition which may have caused issues

pixelsoccupied commented 2 weeks ago

Let's include the golangci-lint yml config and call from our CI job as part of the PR

/kind feature

AlinaSecret commented 1 week ago

@pixelsoccupied @nocturnalastro can we close this?

nocturnalastro commented 1 week ago

Yes