We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
LGTM_INDEX_FILTERS
1 parent 3668ba6 commit 59d239bCopy full SHA for 59d239b
csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/FilePathFilter.cs
@@ -74,16 +74,18 @@ public IEnumerable<FileInfo> Filter(IEnumerable<FileInfo> files)
74
includeByDefault)
75
});
76
77
- // Move included pathfilters to the front of the list:
78
- pathFilters.Sort((pf1, pf2) => -1 * pf1.Include.CompareTo(pf2.Include));
79
return unfilteredResult.Where(f =>
80
{
81
var include = f.FileInclusion.Include;
82
- foreach (var pathFilter in pathFilters)
+ // LGTM_INDEX_FILTERS is a prioritized list, where later filters takes
+ // priority over earlier ones.
+ for (int i = pathFilters.Count - 1; i >= 0; i--)
83
84
+ var pathFilter = pathFilters[i];
85
if (pathFilter.Regex.IsMatch(f.FileInclusion.Path))
86
87
include = pathFilter.Include;
88
+ break;
89
}
90
91
0 commit comments