Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<Project Sdk="Microsoft.NET.Sdk">
...
<ItemGroup>
...
<!-- Reference the NuGet package -->
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
...
</ItemGroup>
...
</Project>
<Project Sdk="Microsoft.NET.Sdk">
...
<!-- Reference the rule set -->
<PropertyGroup>
<CodeAnalysisRuleSet>..\AllRulesDefault.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
...
<ItemGroup>
...
<!-- Reference the NuGet package -->
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
...
</ItemGroup>
...
</Project>
<?xml version="1.0"?>
<RuleSet Name="All Rules with default action"
Description="All Rules with default action. Rules with IsEnabledByDefault = false are disabled."
ToolsVersion="15.0">
...
<Rules AnalyzerId="Microsoft.CodeQuality.Analyzers"
RuleNamespace="Microsoft.CodeQuality.Analyzers">
<Rule Id="CA1000" Action="Warning" /> <!-- Do not declare static members on generic types -->
<Rule Id="CA1008" Action="None" /> <!-- Enums should have zero value -->
...
</Rules>
...
</RuleSet>
dotnet add package Microsoft.CodeAnalysis.FxCopAnalyzers
# Version: 1.3.1 (Using https://semver.org/)
# Updated: 2019-08-04
# See https://github.com/RehanSaeed/EditorConfig/releases for release notes.
# See https://github.com/RehanSaeed/EditorConfig for updates to this file.
# See http://EditorConfig.org for more information about .editorconfig files.
...
##########################################
# .NET Language Conventions
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions
##########################################
# .NET Code Style Settings
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#net-code-style-settings
[*.{cs,csx,cake,vb}]
# "this." and "Me." qualifiers
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#this-and-me
dotnet_style_qualification_for_field = true:warning
dotnet_style_qualification_for_property = true:warning
dotnet_style_qualification_for_method = true:warning
dotnet_style_qualification_for_event = true:warning
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.