Skip to content

WIP: Feature/strict posix glob matcher #662

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

markjschreiber
Copy link
Contributor

Description of changes:

adds support for strict POSIX-compliant glob pattern matching:

  • Implemented StrictPosixGlobPathMatcher class that follows POSIX standards
  • Modified S3FileSystem.getPathMatcher to support 'strict-posix-glob:' syntax
  • Added unit tests for the new matcher implementation
  • Added integration tests for the S3FileSystem path matcher
  • Updated README.md with usage examples

The strict POSIX matcher provides more predictable behavior for directory
boundaries and special character handling compared to the standard glob matcher.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

This commit adds support for strict POSIX-compliant glob pattern matching:

- Implemented StrictPosixGlobPathMatcher class that follows POSIX standards
- Modified S3FileSystem.getPathMatcher to support 'strict-posix-glob:' syntax
- Added unit tests for the new matcher implementation
- Added integration tests for the S3FileSystem path matcher
- Updated README.md with usage examples

The strict POSIX matcher provides more predictable behavior for directory
boundaries and special character handling compared to the standard glob matcher.
Copy link
Contributor

@arouel arouel left a comment

Choose a reason for hiding this comment

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

Nice feature, lgtm


assertThat(matcher.matches(Paths.get("file.txt"))).isTrue();
assertThat(matcher.matches(Paths.get("file.csv"))).isFalse();
assertThat(matcher.matches(Paths.get("dir/file.txt"))).isFalse(); // Should not match across directories
Copy link
Contributor

Choose a reason for hiding this comment

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

Could be helpful when it fails and also gives context as the comment.

Suggested change
assertThat(matcher.matches(Paths.get("dir/file.txt"))).isFalse(); // Should not match across directories
assertThat(matcher.matches(Paths.get("dir/file.txt"))).as("Should not match across directories").isFalse();

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

Successfully merging this pull request may close these issues.

2 participants