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

Reworked ExcludeFileFromGitignore to support leading and trailing wildcards #4649

Merged
merged 3 commits into from
Nov 6, 2024

Conversation

Jenson3210
Copy link
Contributor

What's changed?

There's a bug in the currect version with **/path/ entries. This should be fixed by adding the support + tests.

What's your motivation?

Fix the bug + add wildcard support. We do not support wildcards in the middle part of a path, nor entries with multiple wildcarded parts. Also only the * wildcard for now is supported. Not the ? yet.

Anyone you would like to review specifically?

@lkerford , I thought I said I am DONE with gitignore and NEVER want to see them again... Yet here we go ;)

Checklist

  • I've added unit tests to cover both positive and negative cases
  • I've read and applied the recipe conventions and best practices
  • I've used the IntelliJ IDEA auto-formatter on affected files

Note: when I run the best practices, I also receive changes in lots of other files, so only kept these applicable on my 2 changed files.

@Jenson3210 Jenson3210 changed the title reworked ExcludeFileFromGitignore to support leading and trailing wildcards Reworked ExcludeFileFromGitignore to support leading and trailing wildcards Nov 5, 2024
@@ -268,4 +220,190 @@ private IgnoreNode.MatchResult isIgnored(IgnoreNode ignoreNode, String path) {
return CHECK_PARENT;
}
}

private static class IgnoreRule {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do wonder if we should be applying these changes in our fork of jGit instead, but I think that given we are also making changes to how we want the changes written this is fine

@lkerford lkerford merged commit 420f56d into openrewrite:main Nov 6, 2024
2 checks passed
@Jenson3210 Jenson3210 deleted the rework_gitignore branch November 7, 2024 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants