paths-filter/__tests__
Hesham Salman 835b7f0f9e
fix: honor negation patterns under default predicate quantifier
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
2026-04-27 16:35:11 -04:00
..
csv-escape.test.ts Add list-files: csv format 2021-02-20 11:21:30 +01:00
filter.test.ts fix: honor negation patterns under default predicate quantifier 2026-04-27 16:35:11 -04:00
git.test.ts Support workflows triggered by any event (#44) 2020-10-16 12:28:12 +02:00
shell-escape.test.ts Add list-files: csv format 2021-02-20 11:21:30 +01:00