Skip to content

Commit bc61073

Browse files
authored
Fix globbing (#1459)
1 parent 5aa6521 commit bc61073

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212
- Fix analyzer [RCS1246](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1246) ([PR](https://github.com/dotnet/roslynator/pull/1460))
1313
- Fix analyzer [RCS1085](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1085) ([PR](https://github.com/dotnet/roslynator/pull/1461))
1414
- Fix analyzer [RCS1077](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1077) ([PR](https://github.com/dotnet/roslynator/pull/1463))
15+
- [CLI] Fix `roslynator analyze --include/--exclude` ([PR](https://github.com/dotnet/roslynator/pull/1459))
1516

1617
## [4.12.2] - 2024-04-23
1718

src/Workspaces.Core/Diagnostics/CodeAnalyzer.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,13 @@ private IEnumerable<Diagnostic> FilterDiagnostics(IEnumerable<Diagnostic> diagno
224224
else if (Options.ReportNotConfigurable
225225
|| !diagnostic.Descriptor.CustomTags.Contains(WellKnownDiagnosticTags.NotConfigurable))
226226
{
227-
yield return diagnostic;
227+
SyntaxTree? tree = diagnostic.Location.SourceTree;
228+
229+
if (tree is null
230+
|| Options.FileSystemFilter?.IsMatch(tree.FilePath) != false)
231+
{
232+
yield return diagnostic;
233+
}
228234
}
229235
}
230236
}

0 commit comments

Comments
 (0)