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

path_glob: only match a file for a single pattern #18

Open
jeanlauliac opened this issue Dec 26, 2017 · 0 comments
Open

path_glob: only match a file for a single pattern #18

jeanlauliac opened this issue Dec 26, 2017 · 0 comments

Comments

@jeanlauliac
Copy link
Owner

jeanlauliac commented Dec 26, 2017

The idea is to match patterns in the order of their declaration, to allow matching specific files into a single pattern. Take the following extract of an hypothetical updfile.json:

  "source_patterns": [
    "src/(system/io).cpp",
    "src/(**/*).cpp",
  ],

In this example, if src/system/io.cpp indeed exists, then it would be matched by pattern 0, but not by pattern 1. If people want to use both, then they can specify both sources 0 and 1. This allows people to blacklist specific files, or reserve them for a special use. On the downside, this force people to deduplicate patterns, make sure they don't overlap unexpectedly.

I want this feature is to be able to compile an app with a different io.cpp implementation for unit tests (a mock filesytem).

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

No branches or pull requests

1 participant