Skip to content

Commit 9687484

Browse files
committed
.tool/lint: Ignore dupl complaints for cmd/oci-*/get.go
Don't worry about: $ make lint checking lint cmd/oci-cas/get.go:43::warning: duplicate of cmd/oci-refs/get.go:42-61 (dupl) cmd/oci-refs/get.go:42::warning: duplicate of cmd/oci-cas/get.go:43-62 (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-cas/get.go:..." and "duplicate of get.go:..." if I exclude: "duplicate of cmd/oci-cas/get.go:..." or "duplicate of .*oci-cas/get.go:..." I want to get "oci-cas" and "oci-refs" in the exclusion regular expression somewhere to avoid accidentally skipping dupl checks for other get.go and similar if they show up somewhere else in the repository, so I'm matching on the initial filename. Signed-off-by: W. Trevor King <[email protected]>
1 parent 17d0e64 commit 9687484

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

.tool/lint

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ 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-cas/get.go:.* duplicate of .* \(dupl\)$' \
18+
--exclude='^cmd/oci-refs/get.go:.* duplicate of .* \(dupl\)$' \
1719
--exclude='schema/fs.go' \
1820
--exclude='duplicate of.*main.go.*\(dupl\)$' \
1921
--disable=aligncheck \

0 commit comments

Comments
 (0)