pr-size-labeler icon indicating copy to clipboard operation
pr-size-labeler copied to clipboard

Ignore files and folders by pattern?

Open billxinli opened this issue 3 years ago • 5 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.

billxinli avatar Mar 24 '22 15:03 billxinli

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

morey-tech avatar Jun 17 '22 15:06 morey-tech

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

billxinli avatar Jun 17 '22 15:06 billxinli

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 avatar Jun 17 '22 15:06 morey-tech

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

mediamartin avatar Aug 04 '22 07:08 mediamartin

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

alecmerdler avatar Aug 09 '22 17:08 alecmerdler

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

wu-cl avatar Jan 31 '23 02:01 wu-cl

@rgomezcasas

wu-cl avatar Jan 31 '23 02:01 wu-cl