The --include and --exclude options on the fix command do not filter which files are fixed. All files in the solution are modified regardless of the specified patterns.
The analyze command correctly respects these options (fixed in #1459).
Reproduction: https://github.com/hashiiiii/roslynator-fix-include-bug-repro
roslynator fix ./TestSolution.sln \
--include "ProjectA/**" \
--supported-diagnostics CA1822
Expected: Only files under ProjectA/ are fixed.
Actual: Files under ProjectB/ are also fixed.
In CodeFixer.cs, FileSystemFilter is not checked in GetFixableDiagnostics or FixDiagnosticsAsync. It is only checked in GetDiagnosticsAsync, which runs after the fix loop for reporting purposes.
The
--includeand--excludeoptions on thefixcommand do not filter which files are fixed. All files in the solution are modified regardless of the specified patterns.The
analyzecommand correctly respects these options (fixed in #1459).Reproduction: https://github.com/hashiiiii/roslynator-fix-include-bug-repro
roslynator fix ./TestSolution.sln \ --include "ProjectA/**" \ --supported-diagnostics CA1822Expected: Only files under
ProjectA/are fixed.Actual: Files under
ProjectB/are also fixed.In
CodeFixer.cs,FileSystemFilteris not checked inGetFixableDiagnosticsorFixDiagnosticsAsync. It is only checked inGetDiagnosticsAsync, which runs after the fix loop for reporting purposes.