You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An enhancement for rule S1128 could involve intercepting CS8019 hidden diagnostics for unused 'usings'. The related issue on Roslyn's side can be found here, with the most effective workaround currently detailed in this comment.
We should add something like this to our target files:
<TargetName="__TriggerUnnecessaryUsingsCheck" BeforeTargets="CoreCompile"><!-- Condition to let consuming projects enable documentation file generation themselves --><ItemGroup Condition="'$(GenerateDocumentationFile)' != 'true'"><!-- Trigger compiler check for unnecessary usings --><DocFileItem Include="$(IntermediateOutputPath)DummyDocForUnnecessaryUsings.xml"/></ItemGroup><PropertyGroup Condition="'$(GenerateDocumentationFile)' != 'true'"><!-- we do not want the dummy file in the output folder --><CopyDocumentationFileToOutputDirectory>false</CopyDocumentationFileToOutputDirectory><!-- Disable warnings about missing XML doc comments --><NoWarn>$(NoWarn);CS1591;CS1573;CS1712</NoWarn></PropertyGroup></Target>
This addition will activate IDE0005 warnings in the CLI build, enabling us to refine the S1128 implementation for more precise issue detection. The existing implementation can be retained as a fallback option in instances where the ParseOptions.DocumentationMode property is set to None.
WHY
minimize S1128 false positives and cover all false negatives.
improve S1128 performance.
The text was updated successfully, but these errors were encountered:
cristian-ambrosini-sonarsource
changed the title
Add nuget package to enhance S1128 by enabling IDE0005 warnings in CLI build
Target files: enhance S1128 by enabling IDE0005 warnings in CLI build
Oct 23, 2023
An enhancement for rule S1128 could involve intercepting CS8019 hidden diagnostics for unused 'usings'. The related issue on Roslyn's side can be found here, with the most effective workaround currently detailed in this comment.
We should add something like this to our target files:
This addition will activate IDE0005 warnings in the CLI build, enabling us to refine the S1128 implementation for more precise issue detection. The existing implementation can be retained as a fallback option in instances where the ParseOptions.DocumentationMode property is set to None.
WHY
The text was updated successfully, but these errors were encountered: