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

Ignore files and folders by pattern? #38

Closed
billxinli opened this issue Mar 24, 2022 · 7 comments · Fixed by #50 · May be fixed by #63
Closed

Ignore files and folders by pattern? #38

billxinli opened this issue Mar 24, 2022 · 7 comments · Fixed by #50 · May be fixed by #63

Comments

@billxinli
Copy link

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.

@morey-tech
Copy link

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

@billxinli
Copy link
Author

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

@morey-tech
Copy link

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?

@mediamartin
Copy link

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

@alecmerdler
Copy link

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
Copy link
Contributor

wu-cl commented Jan 31, 2023

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

@wu-cl
Copy link
Contributor

wu-cl commented Jan 31, 2023

@rgomezcasas

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