Skip to content

Commit

Permalink
(maint) Added missing warnings/suggestions to editorconfig
Browse files Browse the repository at this point in the history
These warnings and suggestions currently shows up in Visual Studio,
and as such should also be defined in the editorconfig file in case we
wish to override the severity of the rules.
AdmiringWorm authored and gep13 committed Dec 29, 2020
1 parent 6f87240 commit 0c7d90b
Showing 1 changed file with 53 additions and 15 deletions.
68 changes: 53 additions & 15 deletions src/.editorconfig
Original file line number Diff line number Diff line change
@@ -4,24 +4,56 @@ root = false
## Formatting
dotnet_sort_system_directives_first = true

# CA1031: Do not catch general exception types
dotnet_diagnostic.CA1031.severity = warning

# CA1032: Implement standard exception constructors
dotnet_diagnostic.CA1032.severity = none

# CA1055: URI-like return values should not be strings
dotnet_diagnostic.CA1055.severity = warning

# CA1056: URI-like properties should not be strings
dotnet_diagnostic.CA1056.severity = warning

# CA1062: Validate arguments of public methods
dotnet_diagnostic.CA1062.severity = warning

# CA1303: Do not pass literals as localized parameters
dotnet_diagnostic.CA1303.severity = none

# CA1305: Specify IFormatProvider
dotnet_diagnostic.CA1305.severity = warning

# CA1716: Identifiers should not match keywords
dotnet_diagnostic.CA1716.severity = warning

# CA1814: Prefer jagged arrays over multidimensional
dotnet_diagnostic.CA1814.severity = none

# CA1822: Mark members as static
dotnet_diagnostic.CA1822.severity = warning

# CA1824: Mark assemblies with NeutralResourcesLanguageAttribute
dotnet_diagnostic.CA1824.severity = warning

# CA1826: Do not use Enumerable methods on indexable collections. Instead use the collection directly
dotnet_diagnostic.CA1826.severity = none

# CA2227: Collection properties should be read only
dotnet_diagnostic.CA2227.severity = warning

# IDE0004: Remove Unnecessary Cast
dotnet_diagnostic.IDE0004.severity = warning

# IDE0005: Using directive is unnecessary
dotnet_diagnostic.IDE0005.severity = warning

# IDE0008: Use explicit type
csharp_style_var_elsewhere = true:suggestion
csharp_style_var_for_built_in_types = false:suggestion
csharp_style_var_when_type_is_apparent = false:suggestion

# IDE0018: Variable declaration can be inlined
dotnet_diagnostic.IDE0018.severity = warning

@@ -40,6 +72,12 @@ dotnet_diagnostic.RCS1057.severity = none
# RCS1079: Throwing of new NotImplementedException.
dotnet_diagnostic.RCS1079.severity = warning

# RCS1155: Use StringComparison when comparing strings.
dotnet_diagnostic.RCS1155.severity = warning

# RCS1163: Unused parameter.
dotnet_diagnostic.RCS1163.severity = suggestion

# RCS1194: Implement exception constructors.
dotnet_diagnostic.RCS1194.severity = none

@@ -106,16 +144,16 @@ dotnet_diagnostic.SA1638.severity = error
# SA1649: File name should match first type name
dotnet_diagnostic.SA1649.severity = none

#### Naming styles ####
#### Naming styles ####

## Note, these rules are currently on available in Visual Studio
## not when building using dotnet

# Naming rules
# Naming rules

dotnet_naming_rule.interface_should_be_begins_with_i.severity = error
dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i
dotnet_naming_rule.interface_should_be_begins_with_i.severity = error
dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i

dotnet_naming_rule.types_should_be_pascal_case.severity = error
dotnet_naming_rule.types_should_be_pascal_case.symbols = types
@@ -137,10 +175,10 @@ dotnet_naming_rule.constant_fields_should_use_all_uppercase.severity = error
dotnet_naming_rule.constant_fields_should_use_all_uppercase.symbols = constant_field_members
dotnet_naming_rule.constant_fields_should_use_all_uppercase.style = all_uppercase

# Symbol specifications
# Symbol specifications

dotnet_naming_symbols.interface.applicable_kinds = interface
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.interface.applicable_kinds = interface
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.interface.required_modifiers =

dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
@@ -161,7 +199,7 @@ dotnet_naming_symbols.constant_field_members.applicable_kinds = field
dotnet_naming_symbols.constant_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.constant_field_members.required_modifiers = const

# Naming styles
# Naming styles

dotnet_naming_style.pascal_case.required_prefix =
dotnet_naming_style.pascal_case.required_suffix =
@@ -174,16 +212,16 @@ dotnet_naming_style.begins_with_i.word_separator =
dotnet_naming_style.begins_with_i.capitalization = pascal_case

dotnet_naming_style.camel_case_underscore.required_prefix = _
dotnet_naming_style.camel_case_underscore.required_suffix =
dotnet_naming_style.camel_case_underscore.word_separator =
dotnet_naming_style.camel_case_underscore.required_suffix =
dotnet_naming_style.camel_case_underscore.word_separator =
dotnet_naming_style.camel_case_underscore.capitalization = camel_case

dotnet_naming_style.async_pascal_case.required_prefix =
dotnet_naming_style.async_pascal_case.required_prefix =
dotnet_naming_style.async_pascal_case.required_suffix = Async
dotnet_naming_style.async_pascal_case.word_separator =
dotnet_naming_style.async_pascal_case.word_separator =
dotnet_naming_style.async_pascal_case.capitalization = pascal_case

dotnet_naming_style.all_uppercase.required_prefix =
dotnet_naming_style.all_uppercase.required_suffix =
dotnet_naming_style.all_uppercase.required_prefix =
dotnet_naming_style.all_uppercase.required_suffix =
dotnet_naming_style.all_uppercase.word_separator = _
dotnet_naming_style.all_uppercase.capitalization = all_upper

0 comments on commit 0c7d90b

Please sign in to comment.