Skip to content

package-directory-mismatch false positive for package under version folder #1542

@thespags

Description

@thespags

Describe the bug
I have a version a test package manifest_test in factoid/pkg/apis/manifest/v1, revive gives back

factoid/pkg/apis/manifest/v1/fact_test.go:1:9: package-directory-mismatch: package name "manifest_test" does not match directory name "v1" or parent directory name "manifest" (revive) package manifest_test

However, manifest is a part of manifest_test.

This works fine for non-test code in the package manifest, but not the test code.

To Reproduce
Steps to reproduce the behavior:
Create a folder like
foo/v1/foo_test.go
foo/v1/foo.go
where foo is in package foo and foo_test is in package foo_test, then foo_test will fail revive.

Expected behavior
A clear and concise description of what you expected to happen.

revive should allow package foo_test when it's under foo/v1

Logs
Image

Additional context

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions