mirror of
https://github.com/mgechev/revive.git
synced 2025-01-22 03:38:47 +02:00
fix: dot-imports does not check test files (#884)
This commit is contained in:
parent
883c4cc199
commit
ca0678cd08
@ -39,9 +39,8 @@ type lintImports struct {
|
||||
}
|
||||
|
||||
func (w lintImports) Visit(_ ast.Node) ast.Visitor {
|
||||
for i, is := range w.fileAst.Imports {
|
||||
_ = i
|
||||
if is.Name != nil && is.Name.Name == "." && !w.file.IsTest() {
|
||||
for _, is := range w.fileAst.Imports {
|
||||
if is.Name != nil && is.Name.Name == "." {
|
||||
w.onFailure(lint.Failure{
|
||||
Confidence: 1,
|
||||
Failure: "should not use dot imports",
|
||||
|
Loading…
x
Reference in New Issue
Block a user