Skip to content

Commit

Permalink
fix linter and linting
Browse files Browse the repository at this point in the history
  • Loading branch information
DoctorVin committed Oct 4, 2024
1 parent 93042ae commit 6109cd2
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 14 deletions.
18 changes: 7 additions & 11 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
# golangci.com configuration
# https://github.com/golangci/golangci/wiki/Configuration
service:
golangci-lint-version: 1.50.0 # use the fixed version to not introduce new linters unexpectedly
golangci-lint-version: 1.61.0 # use the fixed version to not introduce new linters unexpectedly

linters-settings:
govet:
enable:
- fieldalignment
enable-all: true
auto-fix: true
check-shadowing: true
settings:
printf:
funcs:
Expand Down Expand Up @@ -65,7 +63,7 @@ linters:
# additional linters
- bodyclose
- gocritic
- goerr113
- err113
- goimports
- revive
- misspell
Expand All @@ -76,14 +74,12 @@ linters:
enable-all: false
disable-all: true

run:
# build-tags:
skip-dirs:
issues:
exclude-dirs:
- internal/fixtures
skip-files:
- internal/model/mock
exclude-files:
- "(.*/)*.*_test.go"

issues:
exclude-rules:
- linters:
- gosec
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,6 @@ github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+Ce
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
github.com/bmc-toolbox/bmclib/v2 v2.3.1-0.20240927204409-62fb8e22434a h1:fff+bV2nG0lldfpiyrM0KN6HSUv4NgEniovOBaV8fWk=
github.com/bmc-toolbox/bmclib/v2 v2.3.1-0.20240927204409-62fb8e22434a/go.mod h1:t8If/0fHQTRIK/yKDk2H3SgthDNNj+7z2aeftDFRFrU=
github.com/bmc-toolbox/bmclib/v2 v2.3.2 h1:RwQVFM3GepHlC7yw6krXoxwKozXB37dcN8e5MKrZYwE=
github.com/bmc-toolbox/bmclib/v2 v2.3.2/go.mod h1:t8If/0fHQTRIK/yKDk2H3SgthDNNj+7z2aeftDFRFrU=
github.com/bmc-toolbox/common v0.0.0-20240926143744-8c478be881d7 h1:Xe6j3oMwe82buwBwEpok9wr+v21Io59pqMTZ5rKRVn8=
Expand Down
4 changes: 3 additions & 1 deletion internal/flipflop/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,8 @@ func (cth *ConditionTaskHandler) validateFirmware(ctx context.Context) error {
}

// XXX: It is incumbent on the caller to close the BMC handle.
//
//nolint:gocyclo // yeah, I know
func validateFirmwareInternal(ctx context.Context, mon model.BMCBootMonitor, update statusUpdate, delay delayFunc) error {
if err := mon.Open(ctx); err != nil {
return fmt.Errorf("opening bmc connection: %w", err)
Expand Down Expand Up @@ -353,7 +355,7 @@ func validateFirmwareInternal(ctx context.Context, mon model.BMCBootMonitor, upd
var err error
for !hostBooted {
// now we've reset the server, give it a chance to come back
if err := delay(ctx); err != nil {
if err = delay(ctx); err != nil {
return fmt.Errorf("context error: %w", err)
}
hostBooted, err = mon.BootComplete()
Expand Down
1 change: 1 addition & 0 deletions internal/flipflop/validation_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (

func defaultBMCTransport() *http.Transport {
return &http.Transport{
//nolint:gosec // BMCs use self-signed certs
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
DisableKeepAlives: true,
Dial: (&net.Dialer{
Expand Down

0 comments on commit 6109cd2

Please sign in to comment.