Skip to content

Commit

Permalink
fix linter
Browse files Browse the repository at this point in the history
  • Loading branch information
tommartensen committed Nov 29, 2024
1 parent af3b2c4 commit 4d47865
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
steps:
- uses: actions/setup-go@v5
with:
go-version: "1.21"
go-version: "1.23"
- name: Checkout
uses: actions/checkout@v4
with:
Expand All @@ -26,7 +26,7 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.58
version: v1.60

shellcheck:
runs-on: ubuntu-latest
Expand Down
13 changes: 5 additions & 8 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ run:
timeout: 16m

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

issues:
exclude-use-default: false
Expand Down Expand Up @@ -36,7 +38,7 @@ linters-settings:
includes:
- G601
revive:
min-confidence: 0
confidence: 0
govet:
enable-all: true
disable:
Expand All @@ -56,16 +58,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 +78,7 @@ linters:
enable:
- asciicheck
# - bodyclose
- copyloopvar
# - deadcode
# - depguard
# - dogsled
Expand All @@ -92,7 +90,6 @@ linters:
# - gochecknoinits
# - gocognit
# - goconst
- exportloopref
- gocritic
# - gocyclo
# - godot
Expand Down
4 changes: 1 addition & 3 deletions scripts/local-dev/go.mod
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
module github.com/stackrox/infra/scripts/local-dev

go 1.22

toolchain go1.22.5
go 1.23

require gopkg.in/yaml.v2 v2.4.0
2 changes: 0 additions & 2 deletions service/cluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,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 4d47865

Please sign in to comment.