php-semver-checker icon indicating copy to clipboard operation
php-semver-checker copied to clipboard

File matching regexes with different level mappings

Open tomzx opened this issue 8 years ago • 6 comments

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 avatar Feb 09 '17 14:02 tomzx

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

spolischook avatar Feb 09 '17 14:02 spolischook

@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.

tomzx avatar Feb 09 '17 14:02 tomzx

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

spolischook avatar Apr 03 '17 15:04 spolischook

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

tomzx avatar Apr 05 '17 17:04 tomzx

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!

spolischook avatar Apr 05 '17 17:04 spolischook

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

tomzx avatar Apr 05 '17 17:04 tomzx