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

fix/perf(forge): improve glob path matching #2480

Merged
merged 1 commit into from Jul 27, 2022

Conversation

mattsse
Copy link
Member

@mattsse mattsse commented Jul 26, 2022

Motivation

the --match-path argument takes a glob, commonly ./test/*, however the leading current path ./ results in mismatches since the matcher is called with test/Contract.sol.
also the matcher was compiled on every invocation

closes #2477

Solution

  • handle ./ case
  • add GlobMatcher type that compiles the glob regex while parsing, so it can be reused efficiently
  • move filter to sub module

@mattsse mattsse added T-bug Type: bug T-perf Type: performance labels Jul 26, 2022
@mattsse mattsse mentioned this pull request Jul 26, 2022
2 tasks
@gakonst gakonst merged commit e8e351e into foundry-rs:master Jul 27, 2022
iFrostizz pushed a commit to iFrostizz/foundry that referenced this pull request Nov 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-bug Type: bug T-perf Type: performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can use --match-path
2 participants