Skip to content

Commit

Permalink
Don't test all rules all the time (#16)
Browse files Browse the repository at this point in the history
Co-authored-by: Hardik Goel <hardik.iitr@gmail.com>
  • Loading branch information
jairbubbles and goelhardik authored Mar 2, 2021
1 parent aefe3d5 commit 968617f
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/Ignore/Ignore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,16 @@ private bool IsPathIgnored(string path)
var ignore = false;
foreach (var rule in rules)
{
var currentMatch = rule.IsMatch(path);
if (currentMatch && !rule.Negate)
if (rule.Negate)
{
ignore = true;
if (ignore && rule.IsMatch(path))
{
ignore = false;
}
}
else if (currentMatch && ignore && rule.Negate)
else if (!ignore && rule.IsMatch(path))
{
ignore = false;
ignore = true;
}
}

Expand Down

0 comments on commit 968617f

Please sign in to comment.