Skip to content

Commit 2baf28b

Browse files
committed
Upgrade the linter
Signed-off-by: David Gageot <[email protected]>
1 parent fce6524 commit 2baf28b

File tree

4 files changed

+7
-10
lines changed

4 files changed

+7
-10
lines changed

cmd/skaffold/app/cmd/completion.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -246,11 +246,10 @@ func NewCmdCompletion(out io.Writer) *cobra.Command {
246246
return completionCmd
247247
}
248248

249-
func runCompletionZsh(out io.Writer) error {
249+
func runCompletionZsh(out io.Writer) {
250250
io.WriteString(out, zshInitialization)
251251
buf := new(bytes.Buffer)
252252
rootCmd.GenBashCompletion(buf)
253253
out.Write(buf.Bytes())
254254
io.WriteString(out, zshTail)
255-
return nil
256255
}

cmd/skaffold/app/cmd/runner.go

+3-6
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,7 @@ func newRunner(opts *config.SkaffoldOptions) (*runner.SkaffoldRunner, *latest.Sk
5757
return nil, nil, errors.Wrap(err, "getting default repo")
5858
}
5959

60-
if err = applyDefaultRepoSubstitution(config, defaultRepo); err != nil {
61-
return nil, nil, errors.Wrap(err, "substituting default repos")
62-
}
60+
applyDefaultRepoSubstitution(config, defaultRepo)
6361

6462
runner, err := runner.NewForConfig(opts, config)
6563
if err != nil {
@@ -69,16 +67,15 @@ func newRunner(opts *config.SkaffoldOptions) (*runner.SkaffoldRunner, *latest.Sk
6967
return runner, config, nil
7068
}
7169

72-
func applyDefaultRepoSubstitution(config *latest.SkaffoldPipeline, defaultRepo string) error {
70+
func applyDefaultRepoSubstitution(config *latest.SkaffoldPipeline, defaultRepo string) {
7371
if defaultRepo == "" {
7472
// noop
75-
return nil
73+
return
7674
}
7775
for _, artifact := range config.Build.Artifacts {
7876
artifact.ImageName = util.SubstituteDefaultRepoIntoImage(defaultRepo, artifact.ImageName)
7977
}
8078
for _, testCase := range config.Test {
8179
testCase.ImageName = util.SubstituteDefaultRepoIntoImage(defaultRepo, testCase.ImageName)
8280
}
83-
return nil
8481
}

hack/linter.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
2020

2121
if ! [ -x "$(command -v golangci-lint)" ]; then
2222
echo "Installing GolangCI-Lint"
23-
${DIR}/install_golint.sh -b $GOPATH/bin v1.12.5
23+
${DIR}/install_golint.sh -b $GOPATH/bin v1.15.0
2424
fi
2525

2626
golangci-lint run \
@@ -32,6 +32,7 @@ golangci-lint run \
3232
-E interfacer \
3333
-E maligned \
3434
-E misspell \
35+
-E stylecheck \
3536
-E unconvert \
3637
-E unparam \
3738
-D errcheck \

pkg/skaffold/deploy/kubectl/labels.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func newLabelsSetter(labels map[string]string) *labelsSetter {
4646
}
4747

4848
func (r *labelsSetter) Matches(key string) bool {
49-
return "metadata" == key
49+
return key == "metadata"
5050
}
5151

5252
func (r *labelsSetter) NewValue(old interface{}) (bool, interface{}) {

0 commit comments

Comments
 (0)