mirror of
https://github.com/dorny/paths-filter.git
synced 2026-06-17 08:57:49 +00:00
A filter rule that mixed positive and bare negation patterns under the
default ('some') predicate quantifier matched nearly every file in a PR.
Each pattern was compiled into its own picomatch matcher and combined
via Array.prototype.some, so a standalone '!**/*.md' (true for any
non-markdown file) flipped the whole rule into a near-universal match.
Group bare string patterns into a single matcher with gitignore-style
semantics: a file matches when it matches at least one positive pattern
and does not match any negation pattern. The 'every' quantifier path is
unchanged, since per-pattern matching under .every() already produces
correct subtractive semantics with negations. The '!(extglob)' single-
string form is preserved by detecting only '!' not followed by '('.
Apply the same gitignore-style grouping to status-tagged array patterns
so 'added: ["src/**", "!**/*.md"]' behaves correctly. Reject rules made
up entirely of negation patterns (no positive include) so the failure
is loud rather than a silent permanent no-match.
Closes dorny/paths-filter#260
|
||
|---|---|---|
| .. | ||
| index.js | ||