Naming rules now work

This commit is contained in:
James Jackson-South
2020-11-24 12:20:43 +00:00
parent 2d2748a7d3
commit 4a1040d1af
4 changed files with 23 additions and 25 deletions

View File

@@ -316,8 +316,9 @@ dotnet_naming_rule.stylecop_constant_fields_must_be_pascal_case_rule.style
dotnet_naming_rule.stylecop_constant_fields_must_be_pascal_case_rule.severity = warning
# All static readonly fields must be PascalCase
# Ajusted to ignore private fields.
# https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1311.md
dotnet_naming_symbols.stylecop_static_readonly_fields_group.applicable_accessibilities = public, internal, protected_internal, protected, private_protected, private
dotnet_naming_symbols.stylecop_static_readonly_fields_group.applicable_accessibilities = public, internal, protected_internal, protected, private_protected
dotnet_naming_symbols.stylecop_static_readonly_fields_group.required_modifiers = static, readonly
dotnet_naming_symbols.stylecop_static_readonly_fields_group.applicable_kinds = field
dotnet_naming_rule.stylecop_static_readonly_fields_must_be_pascal_case_rule.symbols = stylecop_static_readonly_fields_group
@@ -392,22 +393,24 @@ dotnet_naming_rule.type_parameter_rule.symbols = type_parameter_gro
dotnet_naming_rule.type_parameter_rule.style = prefix_type_parameters_with_t_style
dotnet_naming_rule.type_parameter_rule.severity = warning
# Static fields are camelCase and start with s_
dotnet_naming_symbols.static_fields.applicable_kinds = field
dotnet_naming_symbols.static_fields.required_modifiers = static
dotnet_naming_style.static_field_style.capitalization = camel_case
dotnet_naming_style.static_field_style.required_prefix = s_
dotnet_naming_rule.static_fields_should_be_camel_case.style = static_field_style
dotnet_naming_rule.static_fields_should_be_camel_case.symbols = static_fields
dotnet_naming_rule.static_fields_should_be_camel_case.severity = warning
# Private static fields use camelCase and start with s_
dotnet_naming_symbols.private_static_field_symbols.applicable_accessibilities = private
dotnet_naming_symbols.private_static_field_symbols.required_modifiers = static,shared
dotnet_naming_symbols.private_static_field_symbols.applicable_kinds = field
dotnet_naming_rule.private_static_fields_must_be_camel_cased_and_prefixed_with_s_underscore.symbols = private_static_field_symbols
dotnet_naming_rule.private_static_fields_must_be_camel_cased_and_prefixed_with_s_underscore.style = camel_case_and_prefix_with_s_underscore_style
dotnet_naming_rule.private_static_fields_must_be_camel_cased_and_prefixed_with_s_underscore.severity = warning
dotnet_naming_style.camel_case_and_prefix_with_s_underscore_style.required_prefix = s_
dotnet_naming_style.camel_case_and_prefix_with_s_underscore_style.capitalization = camel_case
# Instance fields use camelCase and are prefixed with '_'
dotnet_naming_symbols.instance_fields.applicable_kinds = field
dotnet_naming_style.instance_field_style.capitalization = camel_case
dotnet_naming_style.instance_field_style.required_prefix = _
dotnet_naming_rule.instance_fields_should_be_camel_case.style = instance_field_style
dotnet_naming_rule.instance_fields_should_be_camel_case.symbols = instance_fields
dotnet_naming_rule.instance_fields_should_be_camel_case.severity = warning
dotnet_naming_symbols.private_field_symbols.applicable_accessibilities = private
dotnet_naming_symbols.private_field_symbols.applicable_kinds = field
dotnet_naming_rule.private_instance_fields_must_be_camel_cased_and_prefixed_with_underscore.symbols = private_field_symbols
dotnet_naming_rule.private_instance_fields_must_be_camel_cased_and_prefixed_with_underscore.style = camel_case_and_prefix_with_underscore_style
dotnet_naming_rule.private_instance_fields_must_be_camel_cased_and_prefixed_with_underscore.severity = warning
dotnet_naming_style.camel_case_and_prefix_with_underscore_style.required_prefix = _
dotnet_naming_style.camel_case_and_prefix_with_underscore_style.capitalization = camel_case
# Function parameters use camelCase
# https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-parameters

View File

@@ -14,6 +14,9 @@
<!--Using directive should appear within a namespace declaration-->
<Rule Id="SA1200" Action="None" />
<!--Variable names must not be prefixed-->
<Rule Id="SA1308" Action="None" />
<!--Field names must not begin with underscore-->
<Rule Id="SA1309" Action="None" />

View File

@@ -1,4 +1,4 @@
using System.Reflection;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
@@ -28,7 +28,3 @@ using System.Runtime.InteropServices;
// Umbraco Headless
[assembly: InternalsVisibleTo("Umbraco.Cloud.Headless")]
// code analysis
// IDE1006 is broken, wants _value syntax for consts, etc - and it's even confusing ppl at MS, kill it
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "~_~")]

View File

@@ -1,4 +1,4 @@
using System.Reflection;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
@@ -31,7 +31,3 @@ using System.Runtime.InteropServices;
// Umbraco Headless
[assembly: InternalsVisibleTo("Umbraco.Cloud.Headless")]
// code analysis
// IDE1006 is broken, wants _value syntax for consts, etc - and it's even confusing ppl at MS, kill it
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "~_~")]