pr-size-labeler
pr-size-labeler copied to clipboard
Ignore files and folders by pattern?
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.
https://github.com/CodelyTV/pr-size-labeler/blob/54ef36785e9f4cb5ecf1949cfc9b00dbb621d761/src/github.sh#L24
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.
#50 Here is a solution for this feature, are there someone could review this patch?
@rgomezcasas