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

Overlapping Paths #2

Open
thecoden opened this issue Dec 7, 2020 · 0 comments · May be fixed by #6
Open

Overlapping Paths #2

thecoden opened this issue Dec 7, 2020 · 0 comments · May be fixed by #6

Comments

@thecoden
Copy link

thecoden commented Dec 7, 2020

In ktlint, the team ran into the following issue describing this problem in full:
pinterest/ktlint#942

The fix there simply works around calling the Glob.from() method completely, but causes other issue in doing so. Please see Pull Request coming in shortly.

Regarding the actual issue in code, the problem is an optimization in the visit() method that sorts and folds the given patterns, removing any that overlap. I removed this optimization because:

  1. It would optimize out paths that are substrings of each other as seen in this issue, unless it does further checks.
  2. By performing this optimization it goes against the inclusion, exclusion, inclusion possibilities of patterns because it changes their order, forcing all exclusion patterns to one place in the chain. This seems to go against the goal stated here in the code
thecoden added a commit to codetactics/klob that referenced this issue Dec 7, 2020
thecoden added a commit to codetactics/klob that referenced this issue Dec 8, 2020
@thecoden thecoden linked a pull request Dec 8, 2020 that will close this issue
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 a pull request may close this issue.

1 participant