Conversation
Codecov Report
@@ Coverage Diff @@
## main #6820 +/- ##
========================================
Coverage 96.42% 96.43%
========================================
Files 1401 1408 +7
Lines 334973 335687 +714
Branches 11072 11081 +9
========================================
+ Hits 322997 323704 +707
- Misses 9193 9198 +5
- Partials 2783 2785 +2 |
src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/Maintainability/MakeTypesInternal.cs
Outdated
Show resolved
Hide resolved
| compilationStartContext.RegisterSyntaxNodeAction(AnalyzeTypeDeclaration, TypeKinds); | ||
| compilationStartContext.RegisterSyntaxNodeAction(AnalyzeEnumDeclaration, EnumKind); |
There was a problem hiding this comment.
delegate declaration as well?
...NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/Maintainability/MakeTypesInternal.Fixer.cs
Outdated
Show resolved
Hide resolved
|
@Youssef1313 I have addressed your feedback. |
|
LGTM from a quick glance. One suggestion: Analyzers that operate/bail out based on project output kind should probably be configurable to allow end users to override the applicable output kinds, we added such an option for CA2007: https://github.com/dotnet/roslyn-analyzers/blob/main/docs/Analyzer%20Configuration.md#analyzed-output-kinds |
buyaa-n
left a comment
There was a problem hiding this comment.
Thank you @CollinAlpert, left a few comments, overall looks good.
...zers/CSharp/Microsoft.CodeQuality.Analyzers/Maintainability/CSharpMakeTypesInternal.Fixer.cs
Outdated
Show resolved
Hide resolved
...zers/CSharp/Microsoft.CodeQuality.Analyzers/Maintainability/CSharpMakeTypesInternal.Fixer.cs
Outdated
Show resolved
Hide resolved
...etAnalyzers/Core/Microsoft.CodeQuality.Analyzers/MicrosoftCodeQualityAnalyzersResources.resx
Outdated
Show resolved
Hide resolved
...etAnalyzers/Core/Microsoft.CodeQuality.Analyzers/MicrosoftCodeQualityAnalyzersResources.resx
Outdated
Show resolved
Hide resolved
...etAnalyzers/Core/Microsoft.CodeQuality.Analyzers/MicrosoftCodeQualityAnalyzersResources.resx
Outdated
Show resolved
Hide resolved
...etAnalyzers/Core/Microsoft.CodeQuality.Analyzers/MicrosoftCodeQualityAnalyzersResources.resx
Outdated
Show resolved
Hide resolved
...nalyzers/UnitTests/Microsoft.CodeQuality.Analyzers/Maintainability/MakeTypesInternalTests.cs
Show resolved
Hide resolved
# Conflicts: # src/NetAnalyzers/Core/AnalyzerReleases.Unshipped.md # src/NetAnalyzers/Microsoft.CodeAnalysis.NetAnalyzers.md # src/NetAnalyzers/RulesMissingDocumentation.md
src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/Maintainability/MakeTypesInternal.cs
Outdated
Show resolved
Hide resolved
| SyntaxTree? firstSyntaxTree; | ||
| if (compilation.Options.OutputKind is not (OutputKind.ConsoleApplication or OutputKind.WindowsApplication or OutputKind.WindowsRuntimeApplication) | ||
| || (firstSyntaxTree = context.Compilation.SyntaxTrees.FirstOrDefault()) is null | ||
| || !context.Options.GetOutputKindsOption(Rule, firstSyntaxTree, compilation).Contains(compilation.Options.OutputKind)) |
There was a problem hiding this comment.
Thanks for making OutputKind configurable, though looks with the current logic only OutputKind.ConsoleApplication, OutputKind.WindowsApplication or OutputKind.WindowsRuntimeApplication are configurable, there is no way to enable the rule for OutputKind.DynamicallyLinkedLibrary. I think if it is giving an option to configure, all should be configurable, what you think @CollinAlpert @stephentoub?
Also please add the rule into Configurable Rules list in https://github.com/dotnet/roslyn-analyzers/blob/main/docs/Analyzer%20Configuration.md#analyzed-output-kinds
There was a problem hiding this comment.
I agree, it is better to make all OutputKinds configurable.
...etAnalyzers/Core/Microsoft.CodeQuality.Analyzers/MicrosoftCodeQualityAnalyzersResources.resx
Outdated
Show resolved
Hide resolved
...etAnalyzers/Core/Microsoft.CodeQuality.Analyzers/MicrosoftCodeQualityAnalyzersResources.resx
Outdated
Show resolved
Hide resolved
gewarren
left a comment
There was a problem hiding this comment.
I left a couple suggestions for the resource file.
...etAnalyzers/Core/Microsoft.CodeQuality.Analyzers/MicrosoftCodeQualityAnalyzersResources.resx
Outdated
Show resolved
Hide resolved
...etAnalyzers/Core/Microsoft.CodeQuality.Analyzers/MicrosoftCodeQualityAnalyzersResources.resx
Outdated
Show resolved
Hide resolved
Great, thank you @gewarren! |
buyaa-n
left a comment
There was a problem hiding this comment.
Looks great to me, thank you @CollinAlpert!
Fixes dotnet/runtime#78388