Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package regex does not match package names with numbers #39

Open
mkingvc opened this issue Sep 13, 2024 · 0 comments
Open

Package regex does not match package names with numbers #39

mkingvc opened this issue Sep 13, 2024 · 0 comments

Comments

@mkingvc
Copy link

mkingvc commented Sep 13, 2024

Overview

First let me say thank you for working on this awesome library. I hope to use it soon in production code!

The Problem I'm Seeing

When calling the archunit.Packages() function like:

archunit.Packages("controllers", "internal/controllers/v3")

I am getting an error reading:

"invalid package paths: internal/controllers/v3"

In looking into the implementation of Packages(), the function internal.PkgPattern() is attempting to validate the package path against a regex that fails on the string "v3": ^(?:[a-zA-Z]+(?:\.[a-zA-Z]+)*|\.\.\.)$.

What I Expect

As v3 is a valid golang package name, I would hope that I would be able to use it with archunit.

Possible Solution

The regex would validate my package path if the regex were updated to be: ^(?:[a-zA-Z][a-zA-Z0-9]*(?:\.[a-zA-Z0-9]+)*|\.\.\.)$

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

No branches or pull requests

1 participant