Skip to content

Commit

Permalink
.tool/lint: Ignore dupl complaints for cmd/oci-*/get.go
Browse files Browse the repository at this point in the history
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 <wking@tremily.us>
  • Loading branch information
wking committed Oct 11, 2016
1 parent 23d8fb7 commit ae2075b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .tool/lint
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ for d in $(find . -type d -not -iwholename '*.git*' -a -not -iname '.tool' -a -n
--exclude='error return value not checked.*(Close|Log|Print).*\(errcheck\)$' \
--exclude='.*_test\.go:.*error return value not checked.*\(errcheck\)$' \
--exclude='duplicate of.*_test.go.*\(dupl\)$' \
--exclude='^cmd/oci-cas/get.go:.* duplicate of .* \(dupl\)$' \
--exclude='^cmd/oci-refs/get.go:.* duplicate of .* \(dupl\)$' \
--exclude='schema/fs.go' \
--exclude='duplicate of.*main.go.*\(dupl\)$' \
--disable=aligncheck \
Expand Down

0 comments on commit ae2075b

Please sign in to comment.