Closed xrstf closed 2 months ago
Hi @xrstf thanks for reporting the issue.
Hi! Seems like it`s not a bug. There is just not duplicated-imports rule in default revive configuration https://github.com/mgechev/revive/blob/master/defaults.toml
For enabling this rule just add [rule.duplicated-imports]
in config and run
revive -config config.toml .
Thank you, that was indeed the issue. With the config you provided, revive prints the duplicate imports :-)
Describe the bug I am trying to detect that a package was imported twice in the same file, but using different aliases:
https://github.com/xrstf/prow/blob/b64d12364f91802cfefda3f6e6b79f8d181f2e5f/pkg/plank/controller_test.go#L34-L35 should in my opinion cause a linter error. But when I run revive directly or via golangci-lint, no error is reporting for the duplicate import.
To Reproduce
cd pkg/plank; revive .
Expected behavior I expected an error like
k8s.io/api/core/v1 is imported multiple times in controller_test.go.
. Instead I gotDesktop (please complete the following information):