Skip to content
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 readme for Microsoft.CodeAnalysis.NetAnalyzers package #6303

Merged
merged 2 commits into from
Dec 8, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
add readme file to Microsoft.CodeAnalysis.NetAnalyzers package
  • Loading branch information
jmarolf committed Dec 8, 2022
commit d7abfa74f5a42171f1f85541effa25546946fb4f
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<ContainsPortedFxCopRules>true</ContainsPortedFxCopRules>
<AnalyzerDocumentationFileDir>$(RepoRoot)src\NetAnalyzers</AnalyzerDocumentationFileDir>
<AnalyzerSarifFileDir>$(RepoRoot)src\NetAnalyzers</AnalyzerSarifFileDir>
<PackageReadmeFile>documentation\readme.md</PackageReadmeFile>
<IsShippingPackage>true</IsShippingPackage>

<!-- Override the version prefix and label for NetAnalyzers projects -->
Expand All @@ -24,6 +25,7 @@
<AnalyzerNupkgAssembly Include="Microsoft.CodeAnalysis.NetAnalyzers.dll" />
<AnalyzerNupkgAssembly Include="Microsoft.CodeAnalysis.CSharp.NetAnalyzers.dll" />
<AnalyzerNupkgAssembly Include="Microsoft.CodeAnalysis.VisualBasic.NetAnalyzers.dll" />
<PackageReadmeFileSource Include="..\..\src\NetAnalyzers\readme.md"/>
</ItemGroup>

<ItemGroup>
Expand Down
21 changes: 21 additions & 0 deletions src/NetAnalyzers/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Microsoft.CodeAnalysis.NetAnalyzers

Contains all **the .NET code analysis rules (CAxxxx)** that are built into the .NET SDK starting .NET5 release. The documentation for CA rules can be found at [docs.microsoft.com/visualstudio/code-quality/code-analysis-for-managed-code-warnings](https://learn.microsoft.com/visualstudio/code-quality/code-analysis-for-managed-code-warnings).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

URLs don't match?


You do not need to manually install this NuGet package to your project if you are using .NET5 SDK or later. These analyzers are enabled by default for projects targeting .NET5 or later. For projects targeting earlier .NET frameworks, you can enable them in your MSBuild project file by setting one of the following properties:

1. *EnableNETAnalyzers*

```xml
<PropertyGroup>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
</PropertyGroup>
```

2. *AnalysisLevel*

```xml
<PropertyGroup>
<AnalysisLevel>latest</AnalysisLevel>
</PropertyGroup>
```