Skip to content

Commit 5641105

Browse files
author
Pushparaj Shetty K S
committed
update lint and some dependency version
Signed-off-by: Pushparaj Shetty K S <pshettyks@guidewire.com>
1 parent d2f5598 commit 5641105

File tree

4 files changed

+16
-9
lines changed

4 files changed

+16
-9
lines changed

.golangci.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@ run:
22
timeout: 10m
33

44
skip-files:
5-
- "zz_generated\\..+\\.go$"
6-
- ".*_test.go$"
5+
76

87
output:
98
# colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number"
10-
format: colored-line-number
9+
formats: colored-line-number
1110

1211
linters-settings:
1312
errcheck:
@@ -22,7 +21,7 @@ linters-settings:
2221
# [deprecated] comma-separated list of pairs of the form pkg:regex
2322
# the regex is used to ignore names within pkg. (default "fmt:.*").
2423
# see https://github.com/kisielk/errcheck#the-deprecated-method for details
25-
ignore: fmt:.*,io/ioutil:^Read.*
24+
exclude-functions: fmt:.*,io/ioutil:^Read.*
2625

2726
exhaustive:
2827
# indicates that switch statements are to be considered exhaustive if a
@@ -100,7 +99,6 @@ linters-settings:
10099

101100
linters:
102101
enable:
103-
- megacheck
104102
- govet
105103
- gocyclo
106104
- gocritic
@@ -111,6 +109,9 @@ linters:
111109
- unconvert
112110
- misspell
113111
- nakedret
112+
- staticcheck
113+
- gosimple
114+
- unused
114115

115116
presets:
116117
- bugs
@@ -119,6 +120,12 @@ linters:
119120

120121

121122
issues:
123+
exclude-files:
124+
# Exclude files that are generated by controller-gen.
125+
- "zz_generated\\..+\\.go$"
126+
# Exclude test files.
127+
- ".*_test.go$"
128+
122129
# Excluding configuration per-path and per-linter
123130
exclude-rules:
124131
# Exclude some linters from running on tests files.

controllers/configuration/configuration.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ func ReplaceTerraformSource(remote string, githubBlockedStr string) string {
121121
klog.InfoS("Whether GitHub is blocked", "githubBlocked", githubBlockedStr)
122122
githubBlocked, err := strconv.ParseBool(githubBlockedStr)
123123
if err != nil {
124-
klog.Warningf(errGitHubBlockedNotBoolean, err)
124+
klog.Warningf("%s: %v", errGitHubBlockedNotBoolean, err)
125125
return remote
126126
}
127127
klog.InfoS("Parsed GITHUB_BLOCKED env", "githubBlocked", githubBlocked)

controllers/process/process.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ func New(req ctrl.Request, configuration v1beta2.Configuration, k8sClient client
6666
if jobNodeSelectorStr != "" {
6767
err := json.Unmarshal([]byte(jobNodeSelectorStr), &meta.JobNodeSelector)
6868
if err != nil {
69-
klog.Warningf("the value of JobNodeSelector is not a json string ", err)
69+
klog.Warningf("the value of JobNodeSelector is not a json string: %v", err)
7070
}
7171
}
7272

main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import (
2525
"k8s.io/apiserver/pkg/util/feature"
2626
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
2727
"k8s.io/klog/v2"
28-
"k8s.io/klog/v2/klogr"
28+
"k8s.io/klog/v2/textlogger"
2929
ctrl "sigs.k8s.io/controller-runtime"
3030
"sigs.k8s.io/controller-runtime/pkg/cache"
3131
"sigs.k8s.io/controller-runtime/pkg/metrics/server"
@@ -67,7 +67,7 @@ func main() {
6767
klog.InitFlags(nil)
6868
pflag.Parse()
6969

70-
ctrl.SetLogger(klogr.New())
70+
ctrl.SetLogger(textlogger.NewLogger(textlogger.NewConfig()))
7171

7272
// Prepare manager options
7373
mgmOptions := ctrl.Options{

0 commit comments

Comments
 (0)