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

File matching regexes with different level mappings #92

Open
tomzx opened this issue Feb 9, 2017 · 6 comments
Open

File matching regexes with different level mappings #92

tomzx opened this issue Feb 9, 2017 · 6 comments

Comments

@tomzx
Copy link
Owner

tomzx commented Feb 9, 2017

It might be interesting to allow users to define level mapping based on some form of regex matching.

For example, given a regex that matches a Console/Commands directory, we want to apply at most MINOR levels as we are not expecting users to be inheriting from these commands.

Issue:

  • Multiple regexes may match a file, in which case, which regex/set of mappings should be used?
@tomzx tomzx added this to the Candidate for next Minor milestone Feb 9, 2017
@spolischook
Copy link

Just make your command as final to be sure that it's not extendable

@tomzx
Copy link
Owner Author

tomzx commented Feb 9, 2017

@spolischook Agreed.

However, it is not all code that is written that way and some people may want to use php-semver-checker to check their code dependencies. Thus, the purpose of this idea is to make it easier for them to specify rules that will be more aligned with their use case.

@spolischook
Copy link

Is it possible to remove files from compare by regexp path?

@tomzx
Copy link
Owner Author

tomzx commented Apr 5, 2017

@spolischook At the moment, regexes are not supposed by the file finder, so it is not possible to include/exclude files by regex.

@spolischook
Copy link

I'm using

php-semver-checker compare ./$BASE_VERSION_DIR ./$PR_VERSION_DIR --exclude-after=*/Tests/,*/TestFrameworkBundle/ --exclude-before=*/Tests/,*/TestFrameworkBundle/

and it's works for me!

@tomzx
Copy link
Owner Author

tomzx commented Apr 5, 2017

@spolischook It does support some form of glob file path matching (supports *, ? and [...]), but I assumed you were talking about regex patterns.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants