CodelyTV/pr-size-labeler

Ignore files and folders by pattern?

billxinli opened this issue · 7 comments

Is it possible to ignore files and folders by patterns?

For example, ignoring snapshots directories, ignoring JSON fixtures directories, ignoring some test folders.

Sometimes a change may be a few lines of code, however, the test itself could generate more than the limits defined.

Looking at the scripts, it compares the file_to_ignore string with the basename of the file which means, presently, this is not possible.

if [ "$file_to_ignore" = "$(basename $(jq::base64 '.filename'))" ]; then

Oh interesting. Thank for you looking into this. I think this should be easily added. I might take a stab at this.

I was looking into what it might take to convert that to a globing match. Seems like compgen is an efficient solution for that.

We would need to implement a backwards-compatible solution, something where we default to matching a filename at the end of the path (so any parent directory) and also support more complex patterns. Maybe introduce a new input patterns_to_ignore?

@morey-tech wanted to also use a pattern to ignore so came into this topic. A separate input like patterns_to_ignore would be great!

Would love to see this feature implemented. For our project that relies heavily on OpenAPI code generation, every pull request is being flagged.

wu-cl commented

#50 Here is a solution for this feature, are there someone could review this patch?