Skip to content

Instantly share code, notes, and snippets.

@justinyoo
Last active September 21, 2019 03:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save justinyoo/770b5996aff3f639cd7209a82c222fc2 to your computer and use it in GitHub Desktop.
Save justinyoo/770b5996aff3f639cd7209a82c222fc2 to your computer and use it in GitHub Desktop.
<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