Skip to content

Commit

Permalink
fix: linting
Browse files Browse the repository at this point in the history
  • Loading branch information
msvticket committed Jun 4, 2024
1 parent 0b823bd commit 7b8ebb1
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 28 deletions.
46 changes: 20 additions & 26 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
linters-settings:
depguard:
list-type: blacklist
packages:
- github.com/jenkins-x/jx/v2/pkg/log/
- github.com/satori/go.uuid
- github.com/pborman/uuid
packages-with-error-message:
- github.com/jenkins-x/jx/v2/pkg/log/: "use jenkins-x/jx-logging instead"
- github.com/satori/go.uuid: "use github.com/google/uuid instead"
- github.com/pborman/uuid: "use github.com/google/uuid instead"
rules:
# Name of a rule.
Main:
list-mode: lax
deny:
- pkg: github.com/jenkins-x/jx/v2/pkg/log/
desc: "use jenkins-x/jx-logging instead"
- pkg: github.com/satori/go.uuid
desc: "use github.com/google/uuid instead"
- pkg: github.com/pborman/uuid
desc: "use github.com/google/uuid instead"
dupl:
threshold: 100
exhaustive:
Expand Down Expand Up @@ -37,18 +39,17 @@ linters-settings:
gocyclo:
min-complexity: 15
goimports: {}
golint:
min-confidence: 0
revive:
confidence: 0
gofmt:
simplify: true
gomnd:
settings:
mnd:
# don't include the "operation" and "assign"
checks: [argument, case, condition, return]
mnd:
# don't include the "operation" and "assign"
checks: [argument, case, condition, return]
govet:
check-shadowing: true
settings:
shadow:
strict: true
printf:
funcs:
- (github.com/jenkins-x/jx-logging/v3/pkg/log/Logger()).Debugf
Expand All @@ -58,11 +59,8 @@ linters-settings:
- (github.com/jenkins-x/jx-logging/v3/pkg/log/Logger()).Fatalf
lll:
line-length: 140
maligned:
suggest-new: true
misspell: {}
nolintlint:
allow-leading-space: true # don't 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: false # don't require nolint directives to be specific about which linter is being skipped
Expand Down Expand Up @@ -105,14 +103,10 @@ issues:
exclude:
- 'shadow: declaration of "err" shadows declaration at'
max-same-issues: 0
exclude-dirs:
- cmd/docs

run:
timeout: 30m
skip-dirs:
- cmd/docs
# golangci.com configuration
# https://github.com/golangci/golangci/wiki/Configuration
service:
golangci-lint-version: 1.42.x # use the fixed version to not introduce new linters unexpectedly
prepare:
- echo "here I can run custom commands, but no preparation needed for this repo"
2 changes: 1 addition & 1 deletion scm/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ func (a Action) String() (s string) {
case ActionCompleted:
return "completed"
default:
return
return ""
}
}

Expand Down
2 changes: 1 addition & 1 deletion scm/driver/gitea/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,6 @@ func convertAction(src string) (action scm.Action) {
case "reviewed":
return scm.ActionSubmitted
default:
return
return 0
}
}

0 comments on commit 7b8ebb1

Please sign in to comment.