Skip to content

Commit b9becbd

Browse files
committed
.tool/lint: Ignore dupl complaints for cmd/oci-image-tool/(cas|refs)*.go
Don't worry about: $ make lint checking lint cmd/oci-image-tool/cas_get.go:35::warning: duplicate of cmd/oci-image-tool/refs_get.go:34-45 (dupl) cmd/oci-image-tool/refs_get.go:34::warning: duplicate of cmd/oci-image-tool/refs_list.go:33-44 (dupl) cmd/oci-image-tool/refs_list.go:33::warning: duplicate of cmd/oci-image-tool/cas_get.go:35-46 (dupl) cmd/oci-image-tool/cas_get.go:35::warning: duplicate of cmd/oci-image-tool/refs_get.go:34-66 (dupl) cmd/oci-image-tool/refs_get.go:34::warning: duplicate of cmd/oci-image-tool/cas_get.go:35-67 (dupl) make: *** [lint] Error 1 The commands are all similar (open an engine, perform some method, print the result), but are short enough that extracting out helpers would be more trouble and indirection than it's worth. Oddly, dupl seems happy to print "duplicate of oci-image-tool/refs_get.go:..." and "duplicate of refs_get.go:..." if when I exclude "duplicate of cmd/oci-image-tool/refs_get.go:..." or "duplicate of .*oci-image-tool/refs_get.go:...". I want to get "oci-image-tool" in the exclusion regular expression somewhere to avoid accidentally skipping dupl checks for refs_get.go and similar if they show up somewhere else in the repository, so I'm matching on the initial filename. This commit initially landed before the (cas|refs)_put.go commands. After those commands landed I was getting: cmd/oci-image-tool/cas_put.go:34::warning: duplicate of cmd/oci-image-tool/refs_put.go:36-48 (dupl) cmd/oci-image-tool/refs_put.go:36::warning: duplicate of cmd/oci-image-tool/cas_get.go:36-48 (dupl) So I've rebased this commit to land after the put commands and added ignore lines for those files. I have not updates the line numbers from the earlier 'make lint' quote, so they may have gone stale. I expect they're similar to the quoted values if they've changed at all, since I haven't restructured those files in any major way. Signed-off-by: W. Trevor King <[email protected]>
1 parent 87d6a53 commit b9becbd

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

.tool/lint

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ for d in $(find . -type d -not -iwholename '*.git*' -a -not -iname '.tool' -a -n
1414
--exclude='error return value not checked.*(Close|Log|Print).*\(errcheck\)$' \
1515
--exclude='.*_test\.go:.*error return value not checked.*\(errcheck\)$' \
1616
--exclude='duplicate of.*_test.go.*\(dupl\)$' \
17+
--exclude='^cmd/oci-image-tool/cas_get.go:.* duplicate of .* \(dupl\)$' \
18+
--exclude='^cmd/oci-image-tool/cas_put.go:.* duplicate of .* \(dupl\)$' \
19+
--exclude='^cmd/oci-image-tool/refs_get.go:.* duplicate of .* \(dupl\)$' \
20+
--exclude='^cmd/oci-image-tool/refs_list.go:.* duplicate of .* \(dupl\)$' \
21+
--exclude='^cmd/oci-image-tool/refs_put.go:.* duplicate of .* \(dupl\)$' \
1722
--exclude='schema/fs.go' \
1823
--disable=aligncheck \
1924
--disable=gotype \

0 commit comments

Comments
 (0)