Skip to content

Commit

Permalink
update linter configuration, linter finds
Browse files Browse the repository at this point in the history
  • Loading branch information
tommartensen committed Dec 19, 2024
1 parent 23d35f4 commit cb8505a
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.58
version: v1.62

shellcheck:
runs-on: ubuntu-latest
Expand Down
15 changes: 7 additions & 8 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
run:
timeout: 16m
go: "1.23"

output:
format: "junit-xml:report.xml,colored-line-number"
formats:
- format: colored-line-number
- format: junit-xml
path: report.xml

issues:
exclude-use-default: false
Expand Down Expand Up @@ -36,7 +40,7 @@ linters-settings:
includes:
- G601
revive:
min-confidence: 0
confidence: 0
govet:
enable-all: true
disable:
Expand All @@ -56,16 +60,11 @@ linters-settings:
- Warnf
- Error
- Errorf
gocritic:
enabled-checks:
- commentFormatting
nolintlint:
allow-leading-space: false # require machine-readable nolint directives (i.e. with no leading space)
allow-unused: false # report any unused nolint directives
require-explanation: false # don't require an explanation for nolint directives
require-specific: true # require nolint directives to be specific about which linter is being skipped
staticcheck:
go: "1.20"
checks: [all, -ST1000, -ST1001, -ST1003, -ST1005, -SA1019, -SA4001, -ST1016]
wrapcheck:
ignoreSigRegexps:
Expand All @@ -81,6 +80,7 @@ linters:
enable:
- asciicheck
# - bodyclose
- copyloopvar
# - deadcode
# - depguard
# - dogsled
Expand All @@ -92,7 +92,6 @@ linters:
# - gochecknoinits
# - gocognit
# - goconst
- exportloopref
- gocritic
# - gocyclo
# - godot
Expand Down
2 changes: 1 addition & 1 deletion auth/tokenizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ func (c oidcClaims) Valid() error {
case !strings.HasSuffix(c.Email, emailSuffixRedHat):
errMsg := "email address does not belong to Red Hat"
log.AuditLog(logging.INFO, "oidc-claim-validation", errMsg, "email", c.Email)
return errors.Errorf(errMsg)
return errors.New(errMsg)
default:
// Use an empty jwt.Expected to skip non-time-related validation and use time.Now()
// for the validation.
Expand Down
2 changes: 0 additions & 2 deletions service/cluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,6 @@ func (s *clusterImpl) List(ctx context.Context, request *v1.ClusterListRequest)
// Loop over all of the workflows, and keep only the ones that match our
// request criteria.
for _, workflow := range workflowList.Items {
workflow := workflow

// This cluster is expired, and we did not request to include expired
// clusters.
if !request.Expired && isWorkflowExpired(workflow) {
Expand Down
1 change: 0 additions & 1 deletion service/flavor.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ func NewFlavorService(registry *flavor.Registry) (middleware.APIService, error)
func (s *flavorImpl) List(_ context.Context, request *v1.FlavorListRequest) (*v1.FlavorListResponse, error) {
var resp v1.FlavorListResponse
for _, flavor := range s.registry.Flavors() {
flavor := flavor
if !request.All && flavor.Availability == v1.Flavor_alpha {
continue
}
Expand Down

0 comments on commit cb8505a

Please sign in to comment.