mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Style: Update StyleCop rules (#8500)
This commit is contained in:
+60
-1
@@ -12,6 +12,19 @@
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="FieldsMustBePrivate">
|
||||
<!-- it's OK to have internal or public fields -->
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="CodeAnalysisSuppressionMustHaveJustification">
|
||||
<!-- code analysis SuppressMessage attributes are from legacy code,
|
||||
it's OK to not include a justification. -->
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
</Rules>
|
||||
<AnalyzerSettings />
|
||||
</Analyzer>
|
||||
@@ -83,7 +96,10 @@
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
</Rules>
|
||||
<AnalyzerSettings />
|
||||
<AnalyzerSettings>
|
||||
<BooleanProperty Name="IgnorePrivates">True</BooleanProperty>
|
||||
<BooleanProperty Name="IgnoreInternals">True</BooleanProperty>
|
||||
</AnalyzerSettings>
|
||||
</Analyzer>
|
||||
<Analyzer AnalyzerId="StyleCop.CSharp.NamingRules">
|
||||
<Rules>
|
||||
@@ -92,6 +108,24 @@
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="VariableNamesMustNotBePrefixed">
|
||||
<!-- this rule disallows the prefix 's_' to static fields -->
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="StaticReadonlyFieldsMustBeginWithUpperCaseLetter">
|
||||
<!-- this rule requires first letter upper-case even for private fields -->
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="FieldNamesMustNotContainUnderscore">
|
||||
<!-- this rule disallows '_' in field name -->
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
</Rules>
|
||||
<AnalyzerSettings />
|
||||
</Analyzer>
|
||||
@@ -117,6 +151,31 @@
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="StaticElementsMustAppearBeforeInstanceElements">
|
||||
<!-- it's OK to have static members after instance members -->
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
</Rules>
|
||||
<AnalyzerSettings />
|
||||
</Analyzer>
|
||||
<Analyzer AnalyzerId="StyleCop.CSharp.LayoutRules">
|
||||
<Rules>
|
||||
<Rule Name="ElementMustNotBeOnSingleLine">
|
||||
<!-- it's OK to have simple member on a single line.
|
||||
think about the 'Visit*' methods in Ast visitor class. -->
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="AllAccessorsMustBeSingleLineOrMultiLine">
|
||||
<!-- it's OK to have the getter be on a single line and the
|
||||
setter be on multiple lines, or vice versa -->
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
</Rules>
|
||||
<AnalyzerSettings />
|
||||
</Analyzer>
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@
|
||||
},
|
||||
"namingRules" : {
|
||||
"allowCommonHungarianPrefixes" : true,
|
||||
"allowedHungarianPrefixes" : [ "c", "r" ]
|
||||
"allowedHungarianPrefixes" : [ "n", "r", "l", "i", "io", "fs", "lp", "dw", "h", "rs", "ps", "op" ]
|
||||
},
|
||||
"maintainabilityRules" : {
|
||||
"topLevelTypes" : [
|
||||
|
||||
Reference in New Issue
Block a user