Skip to content

package-directory-mismatch: allow test package names in version paths#1547

Merged
chavacava merged 3 commits intomgechev:masterfrom
thespags:master
Oct 23, 2025
Merged

package-directory-mismatch: allow test package names in version paths#1547
chavacava merged 3 commits intomgechev:masterfrom
thespags:master

Conversation

@thespags
Copy link
Copy Markdown
Contributor

@thespags thespags commented Oct 15, 2025

Added test case following the other PackageDirectoryMismatchRule tests.

Closes #1542.

@alexandear alexandear changed the title fix: Allow test package names in version paths. package-directory-mismatch: allow test package names in version paths Oct 15, 2025
@thespags
Copy link
Copy Markdown
Contributor Author

Hi @alexandear , can I get help debugging why the file isn't appearing in CI?

Error: package_directory_mismatch_test.go:40: Bad filename path in test for package-directory-mismatch: open ../testdata/package_directory_mismatch/api/v1/api_test.go: no such file or directory

@alexandear
Copy link
Copy Markdown
Collaborator

alexandear commented Oct 15, 2025

Hi @alexandear , can I get help debugging why the file isn't appearing in CI?

Error: package_directory_mismatch_test.go:40: Bad filename path in test for package-directory-mismatch: open ../testdata/package_directory_mismatch/api/v1/api_test.go: no such file or directory

You need to rename the V1 directory to v1. Ubuntu is a case-sensitive OS.

image

@alexandear alexandear self-requested a review October 15, 2025 20:01
@thespags
Copy link
Copy Markdown
Contributor Author

Thanks @alexandear, I'm following the other test which has a case for v1 and V1

testRule(t, "package_directory_mismatch/api/v1/api", &rule.PackageDirectoryMismatchRule{}, config)

@thespags
Copy link
Copy Markdown
Contributor Author

Who's someone that can merge @alexandear? Thanks.

@thespags
Copy link
Copy Markdown
Contributor Author

@uloamaka do you have access to merge this?

@alexandear
Copy link
Copy Markdown
Collaborator

alexandear commented Oct 22, 2025

@thespags I'll merge the PR tomorrow if @chavacava or @denisvmedia don't review it. Thanks for your patience.

@chavacava chavacava merged commit 91147bf into mgechev:master Oct 23, 2025
10 checks passed
@chavacava
Copy link
Copy Markdown
Collaborator

Thank you @thespags for the PR and @alexandear for the reviews and feedback

@thespags
Copy link
Copy Markdown
Contributor Author

Thank you!

@alexandear alexandear mentioned this pull request Nov 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

3 participants