-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Enable build time warnings for IDE code analysis rules #34215
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -195,6 +195,7 @@ dotnet_diagnostic.CA2208.severity = warning | |
| dotnet_diagnostic.IDE0035.severity = warning | ||
|
|
||
| # IDE0036: Order modifiers | ||
| csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:suggestion | ||
| dotnet_diagnostic.IDE0036.severity = warning | ||
|
|
||
| # IDE0043: Format string contains invalid placeholder | ||
|
|
@@ -204,7 +205,7 @@ dotnet_diagnostic.IDE0043.severity = warning | |
| dotnet_diagnostic.IDE0044.severity = warning | ||
|
|
||
| # IDE0073: File header | ||
| dotnet_diagnostic.IDE0073.severity = warning | ||
| dotnet_diagnostic.IDE0073.severity = suggestion | ||
|
||
| file_header_template = Copyright (c) .NET Foundation. All rights reserved.\nLicensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
|
||
| [**/{test,samples,perf}/**.{cs,vb}] | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,6 +27,9 @@ | |
| '$(ISBenchmarkProject)' == 'true' OR | ||
| '$(IsSampleProject)' == 'true' OR | ||
| '$(IsMicrobenchmarksProject)' == 'true'">$(NoWarn);CA1416</NoWarn> | ||
|
|
||
| <!-- Enable .NET code style analysis during build for src projects. --> | ||
| <EnforceCodeStyleInBuild Condition="'$(EnforceCodeStyleInBuild)' == ''">true</EnforceCodeStyleInBuild> | ||
|
||
| </PropertyGroup> | ||
|
|
||
| <ItemGroup Condition=" '$(DotNetBuildFromSource)' != 'true' AND $(AddPublicApiAnalyzers) "> | ||
|
|
||
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.
Based on https://github.com/dotnet/runtime/blob/main/.editorconfig#L42 (also what the analyzer defaults to)