Unfortunately due to bugs in the analyzers or something else, the IDE0005 doesn't work as expected. The "officially suggested" workaround is to enable XML documentation generation to trigger IDE0005 during compiling. Then we need to add three more rules to silence the warnings that come from the XML documentation generation. We also need to enable code style enforcing on build for all of this to work. Known issue is that all of this produces a bunch (tens to hundreds) of obscure analyzer warnings on older versions of Visual Studio, but those seem to not be causing issues.
68 lines
4.7 KiB
XML
68 lines
4.7 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<RuleSet Name="OpenRA Code Style" ToolsVersion="14.0">
|
|
|
|
<IncludeAll Action="Warning" />
|
|
|
|
<!-- Rules related to generating XML documentation that we need to silence. -->
|
|
<!-- These are here because of GenerateDocumentationFile, which is a workaround for forcing rule IDE0005 to work outside of an IDE. -->
|
|
<Rules AnalyzerId="Microsoft.CodeAnalysis.CSharp" RuleNamespace="Microsoft.CodeAnalysis.CSharp">
|
|
<Rule Id="CS1570" Action="None" /><!-- Invalid XML in XML comment. -->
|
|
<Rule Id="CS1573" Action="None" /><!-- Parameter has no matching param tag in the XML comment. -->
|
|
<Rule Id="CS1591" Action="None" /><!-- Missing XML comment for publicly visible type or member. -->
|
|
</Rules>
|
|
|
|
<Rules AnalyzerId="Microsoft.CodeAnalysis.CSharp.CodeStyle" RuleNamespace="Microsoft.CodeAnalysis.CSharp.CodeStyle">
|
|
<Rule Id="IDE0005" Action="Warning" /><!-- Using directive is unnecessary. -->
|
|
</Rules>
|
|
|
|
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers">
|
|
<Rule Id="SX1101" Action="Warning" /><!-- DoNotPrefixLocalMembersWithThis -->
|
|
|
|
<!-- Rules that conflict with OpenRA project style conventions -->
|
|
<Rule Id="SA0001" Action="None" /><!-- XmlCommentAnalysisDisabled -->
|
|
<Rule Id="SA1101" Action="None" /><!-- PrefixLocalCallsWithThis -->
|
|
<Rule Id="SA1117" Action="None" /><!-- ParametersMustBeOnSameLineOrSeparateLines -->
|
|
<Rule Id="SA1118" Action="None" /><!-- ParameterMustNotSpanMultipleLines -->
|
|
<Rule Id="SA1122" Action="None" /><!-- UseStringEmptyForEmptyStrings -->
|
|
<Rule Id="SA1124" Action="None" /><!-- DoNotUseRegions -->
|
|
<Rule Id="SA1127" Action="None" /><!-- GenericTypeConstraintsMustBeOnOwnLine -->
|
|
<Rule Id="SA1135" Action="None" /><!-- UsingDirectivesMustBeQualified -->
|
|
<Rule Id="SA1136" Action="None" /><!-- EnumValuesShouldBeOnSeparateLines -->
|
|
<Rule Id="SA1200" Action="None" /><!-- UsingDirectivesMustBePlacedCorrectly -->
|
|
<Rule Id="SA1201" Action="None" /><!-- ElementsMustAppearInTheCorrectOrder -->
|
|
<Rule Id="SA1202" Action="None" /><!-- ElementsMustBeOrderedByAccess -->
|
|
<Rule Id="SA1314" Action="None" /><!-- TypeParameterNamesMustBeginWithT -->
|
|
<Rule Id="SA1400" Action="None" /><!-- AccessModifierMustBeDeclared -->
|
|
<Rule Id="SA1401" Action="None" /><!-- FieldsMustBePrivate -->
|
|
<Rule Id="SA1402" Action="None" /><!-- FileMayOnlyContainASingleType -->
|
|
<Rule Id="SA1407" Action="None" /><!-- ArithmeticExpressionsMustDeclarePrecedence -->
|
|
<Rule Id="SA1501" Action="None" /><!-- StatementMustNotBeOnSingleLine -->
|
|
<Rule Id="SA1502" Action="None" /><!-- ElementMustNotBeOnSingleLine -->
|
|
<Rule Id="SA1503" Action="None" /><!-- BracesMustNotBeOmitted -->
|
|
<Rule Id="SA1519" Action="None" /><!-- BracesMustNotBeOmittedFromMultiLineChildStatement -->
|
|
<Rule Id="SA1520" Action="None" /><!-- UseBracesConsistently -->
|
|
<Rule Id="SA1600" Action="None" /><!-- ElementsMustBeDocumented -->
|
|
<Rule Id="SA1601" Action="None" /><!-- PartialElementsMustBeDocumented -->
|
|
<Rule Id="SA1602" Action="None" /><!-- EnumerationItemsMustBeDocumented -->
|
|
<Rule Id="SA1633" Action="None" /><!-- FileMustHaveHeader -->
|
|
<Rule Id="SA1649" Action="None" /><!-- FileNameMustMatchTypeName -->
|
|
|
|
<!-- Rules that could potentially be enabled after existing violations are fixed -->
|
|
<Rule Id="SA1027" Action="None" /><!-- UseTabsCorrectly -->
|
|
<Rule Id="SA1107" Action="None" /><!-- CodeMustNotContainMultipleStatementsOnOneLine -->
|
|
<Rule Id="SA1116" Action="None" /><!-- SplitParametersMustStartOnLineAfterDeclaration -->
|
|
<Rule Id="SA1119" Action="None" /><!-- StatementMustNotUseUnnecessaryParenthesis -->
|
|
<Rule Id="SA1132" Action="None" /><!-- DoNotCombineFields -->
|
|
<Rule Id="SA1204" Action="None" /><!-- StaticElementsMustAppearBeforeInstanceElements -->
|
|
<Rule Id="SA1214" Action="None" /><!-- ReadonlyElementsMustAppearBeforeNonReadonlyElements -->
|
|
<Rule Id="SA1413" Action="None" /><!-- UseTrailingCommasInMultiLineInitializers -->
|
|
<Rule Id="SA1516" Action="None" /><!-- ElementsMustBeSeparatedByBlankLine -->
|
|
<Rule Id="SA1604" Action="None" /><!-- ElementDocumentationShouldHaveSummary -->
|
|
<Rule Id="SA1611" Action="None" /><!-- ElementParametersShouldBeDocumented -->
|
|
<Rule Id="SA1615" Action="None" /><!-- ElementReturnValueShouldBeDocumented -->
|
|
<Rule Id="SA1618" Action="None" /><!-- GenericTypeParametersShouldBeDocumented -->
|
|
<Rule Id="SA1623" Action="None" /><!-- PropertySummaryDocumentationShouldMatchAccessors -->
|
|
<Rule Id="SA1629" Action="None" /><!-- DocumentationTextShouldEndWithAPeriod -->
|
|
<Rule Id="SA1642" Action="None" /><!-- ConstructorSummaryDocumentationShouldBeginWithStandardText -->
|
|
</Rules>
|
|
</RuleSet> |