-
Notifications
You must be signed in to change notification settings - Fork 464
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
Add PreferTypedStringBuilderAppendOverloads analyzer + fixer #3443
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3443 +/- ##
========================================
Coverage 95.27% 95.28%
========================================
Files 1006 1009 +3
Lines 230946 231260 +314
Branches 14921 14939 +18
========================================
+ Hits 220041 220346 +305
- Misses 9259 9263 +4
- Partials 1646 1651 +5 |
FYI: You will need to fix a new RS diagnostic once #3444 goes in - should be easy to fix with an IDE code fix. |
aa38fa5
to
3a8fdd9
Compare
Done. |
80b17a0
to
ef49826
Compare
src/Microsoft.CodeAnalysis.Analyzers/Microsoft.CodeAnalysis.Analyzers.md
Outdated
Show resolved
Hide resolved
...rs/Core/Microsoft.NetCore.Analyzers/Runtime/PreferTypedStringBuilderAppendOverloads.Fixer.cs
Outdated
Show resolved
Hide resolved
...rs/Core/Microsoft.NetCore.Analyzers/Runtime/PreferTypedStringBuilderAppendOverloads.Fixer.cs
Outdated
Show resolved
Hide resolved
...nitTests/Microsoft.NetCore.Analyzers/Runtime/PreferTypedStringBuilderAppendOverloadsTests.cs
Outdated
Show resolved
Hide resolved
...nitTests/Microsoft.NetCore.Analyzers/Runtime/PreferTypedStringBuilderAppendOverloadsTests.cs
Outdated
Show resolved
Hide resolved
...nitTests/Microsoft.NetCore.Analyzers/Runtime/PreferTypedStringBuilderAppendOverloadsTests.cs
Outdated
Show resolved
Hide resolved
...nitTests/Microsoft.NetCore.Analyzers/Runtime/PreferTypedStringBuilderAppendOverloadsTests.cs
Show resolved
Hide resolved
...nalyzers/Core/Microsoft.NetCore.Analyzers/Runtime/PreferTypedStringBuilderAppendOverloads.cs
Show resolved
Hide resolved
ef49826
to
95e6f89
Compare
I have a question about this PR, @stephentoub: The original issue was categorized by Immo as "Performance", but this PR adds the analyzer inside the Runtime folder instead of the Performance folder. Why is that?
I have this issue assigned to me to create an analyzer, and was also categorized as "Performance", so I'd like to know how to decide in which folder should I create my analyzer. |
[InlineData("object", false)] | ||
[InlineData("char[]", false)] | ||
[InlineData("DateTime", false)] | ||
[InlineData("DayOfWeek", false)] |
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.
Is this to cover the generalized enum scenario?
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.
Yup.
The categorization that's important is this one: |
Agree with @stephentoub - the important bit is the category set in the descriptor. Ideally, the folder structure will match the rule category, but it has been out of sync for a while. We have wanted to correct it, but never got to prioritize that work. We can even consider flattening the files into a single folder, i.e. put all analyzers under the folder https://github.com/dotnet/roslyn-analyzers/tree/master/src/NetAnalyzers/Core/Microsoft.NetCore.Analyzers and remove all sub-folders. |
Fixes dotnet/runtime#33787
cc: @bartonjs, @jeffhandley, @mavasani, @sharwell