-
Notifications
You must be signed in to change notification settings - Fork 459
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
Enable generated code analysis but analyze razor/cshtml pages only #5976
Conversation
.../UnitTests/Microsoft.NetCore.Analyzers/InteropServices/PlatformCompatibilityAnalyzerTests.cs
Show resolved
Hide resolved
@@ -126,13 +125,15 @@ public sealed partial class PlatformCompatibilityAnalyzer : DiagnosticAnalyzer | |||
isPortedFxCopRule: false, | |||
isDataflowRule: false); | |||
|
|||
protected abstract bool IsSingleLineComment(SyntaxTrivia trivia); |
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.
We might want to move the language specific code into the Utilities
instead
Codecov Report
@@ Coverage Diff @@
## main #5976 +/- ##
==========================================
- Coverage 96.03% 96.03% -0.01%
==========================================
Files 1338 1341 +3
Lines 307197 307463 +266
Branches 9788 9814 +26
==========================================
+ Hits 295014 295258 +244
- Misses 9805 9827 +22
Partials 2378 2378 |
...tAnalyzers/Core/Microsoft.NetCore.Analyzers/InteropServices/PlatformCompatibilityAnalyzer.cs
Show resolved
Hide resolved
.../UnitTests/Microsoft.NetCore.Analyzers/InteropServices/PlatformCompatibilityAnalyzerTests.cs
Show resolved
Hide resolved
.../UnitTests/Microsoft.NetCore.Analyzers/InteropServices/PlatformCompatibilityAnalyzerTests.cs
Outdated
Show resolved
Hide resolved
.../UnitTests/Microsoft.NetCore.Analyzers/InteropServices/PlatformCompatibilityAnalyzerTests.cs
Outdated
Show resolved
Hide resolved
.../UnitTests/Microsoft.NetCore.Analyzers/InteropServices/PlatformCompatibilityAnalyzerTests.cs
Outdated
Show resolved
Hide resolved
.../UnitTests/Microsoft.NetCore.Analyzers/InteropServices/PlatformCompatibilityAnalyzerTests.cs
Outdated
Show resolved
Hide resolved
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.
Please add VB tests and also confirm this does not affect build performance, given this analyzer is on by default on command line.
Moving to draft until dotnet/roslyn#7578 resolved and the |
@buyaa-n dotnet/roslyn#7578 has been implemented, so we should soon have a public API |
Closing out this old draft PR |
Fixes #5971
CA1416 is disabled for generated code, but we need to enable them for razor/shtml pages
As proposed in dotnet/roslyn#39758: Roslyn already recognizes
<auto-generated />
in a comment on the beginning of source files. We could extend this with an optional type attribute:// <auto-generated type="Razor" />
We also want to support *.cshtml files, that means the type name might change
- [ ] Add VB testVB not supportedtype="Razor"
attribute to the<auto-generated/>
commentCreating the PR as a draft until all checks fixedThe PR now ready for review