Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit 7219043

Browse files
author
Ian Campbell
committed
Update nolint comments.
I figured out that adding a second `//` lets you inline the commentary. Without that it complains about unknown linters (because it tries to interpret the comment as a list of linters). Signed-off-by: Ian Campbell <[email protected]>
1 parent 91c4bf3 commit 7219043

File tree

3 files changed

+4
-9
lines changed

3 files changed

+4
-9
lines changed

internal/commands/push.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,7 @@ func (r *interactiveDisplay) onEvent(ev remotes.FixupEvent) {
183183
for _, s := range r.images {
184184
r.previousLineCount += s.print(out)
185185
}
186-
// nolint because there is nothing much we can do with an error to write to our output.
187-
r.out.Write(out.Bytes()) //nolint:errcheck
186+
r.out.Write(out.Bytes()) //nolint:errcheck // nothing much we can do with an error to write to output.
188187
}
189188

190189
func (r *interactiveDisplay) imageIndex(name string) int {

internal/commands/root.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,9 @@ func firstOrEmpty(list []string) string {
4949
func muteDockerCli(dockerCli command.Cli) func() {
5050
stdout := dockerCli.Out()
5151
stderr := dockerCli.Err()
52-
// nolint because WithCombinedStreams cannot error
53-
dockerCli.Apply(command.WithCombinedStreams(ioutil.Discard)) //nolint:errcheck
52+
dockerCli.Apply(command.WithCombinedStreams(ioutil.Discard)) //nolint:errcheck // WithCombinedStreams cannot error
5453
return func() {
55-
dockerCli.Apply(command.WithOutputStream(stdout), command.WithErrorStream(stderr)) //nolint:errcheck
54+
dockerCli.Apply(command.WithOutputStream(stdout), command.WithErrorStream(stderr)) //nolint:errcheck // as above
5655
}
5756
}
5857

pkg/yatee/yatee_test.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,7 @@ func TestEval(t *testing.T) {
2828
testEval(t, "${foo?foo:bar}", env, "foo")
2929
}
3030

31-
// The nolint is because `parameters` is always the same, but it is
32-
// preferable to keep the definition in the caller since it
33-
// corresponds to `input` and `output`.
34-
func testProcess(t *testing.T, input, output, parameters, error string) { //nolint:unparam
31+
func testProcess(t *testing.T, input, output, parameters, error string) { //nolint:unparam // `parameters` defined near `input` and `output`.
3532
ps := make(map[interface{}]interface{})
3633
err := yaml.Unmarshal([]byte(parameters), ps)
3734
assert.NilError(t, err)

0 commit comments

Comments
 (0)