New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid name collision of analyzer class names and title resources #6346
base: main
Are you sure you want to change the base?
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #6346 +/- ##
=======================================
Coverage 96.08% 96.08%
=======================================
Files 1366 1366
Lines 315512 315512
Branches 10187 10187
=======================================
+ Hits 303145 303146 +1
+ Misses 9934 9933 -1
Partials 2433 2433 |
@@ -10,7 +10,7 @@ namespace Microsoft.NetCore.Analyzers.Security | |||
using static MicrosoftNetCoreAnalyzersResources; | |||
|
|||
[DiagnosticAnalyzer(LanguageNames.CSharp, LanguageNames.VisualBasic)] | |||
public class DoNotAddArchiveItemPathToTheTargetFileSystemPath : SourceTriggeredTaintedDataAnalyzerBase | |||
public class DoNotAddArchiveItemPathToTheTargetFileSystemPathAnalyzer : SourceTriggeredTaintedDataAnalyzerBase |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to rename all the files to match the new type name?
Actually, I feel a better fix here is to rename the resource strings to always end with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As per the last comment.
Found during the work for unused resources analyzer.
The following line (as an example):
roslyn-analyzers/src/NetAnalyzers/Core/Microsoft.NetCore.Analyzers/Security/DoNotAddArchiveItemPathToTheTargetFileSystemPath.cs
Line 19 in ed54cef
binds to the class, instead of binding to the resource:
roslyn-analyzers/src/NetAnalyzers/Core/Microsoft.NetCore.Analyzers/MicrosoftNetCoreAnalyzersResources.resx
Lines 1083 to 1085 in ed54cef
Causing an incorrect "unused resource" warning.
Having different names will avoid this warning and will let
nameof(...)
bind properly to the resource.