|
| 1 | +[*.cs] |
| 2 | + |
| 3 | +# Default severity for analyzer diagnostics with category 'Style' |
| 4 | +dotnet_analyzer_diagnostic.category-Style.severity = silent |
| 5 | +csharp_indent_labels = one_less_than_current |
| 6 | +csharp_using_directive_placement = outside_namespace:silent |
| 7 | +csharp_prefer_simple_using_statement = true:suggestion |
| 8 | +csharp_prefer_braces = true:silent |
| 9 | +csharp_style_namespace_declarations = block_scoped:silent |
| 10 | +csharp_style_prefer_method_group_conversion = true:silent |
| 11 | +csharp_style_prefer_top_level_statements = true:silent |
| 12 | +csharp_style_prefer_primary_constructors = true:suggestion |
| 13 | +csharp_prefer_system_threading_lock = true:suggestion |
| 14 | +csharp_style_expression_bodied_methods = when_on_single_line:silent |
| 15 | +csharp_style_expression_bodied_constructors = when_on_single_line:silent |
| 16 | +csharp_style_expression_bodied_operators = when_on_single_line:silent |
| 17 | +csharp_style_expression_bodied_properties = true:silent |
| 18 | +csharp_style_expression_bodied_indexers = true:silent |
| 19 | +csharp_style_expression_bodied_accessors = true:silent |
| 20 | +csharp_style_expression_bodied_lambdas = when_on_single_line:silent |
| 21 | +csharp_style_expression_bodied_local_functions = true:silent |
| 22 | +csharp_space_around_binary_operators = before_and_after |
| 23 | + |
| 24 | +[*.{cs,vb}] |
| 25 | +#### Naming styles #### |
| 26 | + |
| 27 | +# Naming rules |
| 28 | + |
| 29 | +dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion |
| 30 | +dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface |
| 31 | +dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i |
| 32 | + |
| 33 | +dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion |
| 34 | +dotnet_naming_rule.types_should_be_pascal_case.symbols = types |
| 35 | +dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case |
| 36 | + |
| 37 | +dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion |
| 38 | +dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members |
| 39 | +dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case |
| 40 | + |
| 41 | +# Symbol specifications |
| 42 | + |
| 43 | +dotnet_naming_symbols.interface.applicable_kinds = interface |
| 44 | +dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected |
| 45 | +dotnet_naming_symbols.interface.required_modifiers = |
| 46 | + |
| 47 | +dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum |
| 48 | +dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected |
| 49 | +dotnet_naming_symbols.types.required_modifiers = |
| 50 | + |
| 51 | +dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method |
| 52 | +dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected |
| 53 | +dotnet_naming_symbols.non_field_members.required_modifiers = |
| 54 | + |
| 55 | +# Naming styles |
| 56 | + |
| 57 | +dotnet_naming_style.begins_with_i.required_prefix = I |
| 58 | +dotnet_naming_style.begins_with_i.required_suffix = |
| 59 | +dotnet_naming_style.begins_with_i.word_separator = |
| 60 | +dotnet_naming_style.begins_with_i.capitalization = pascal_case |
| 61 | + |
| 62 | +dotnet_naming_style.pascal_case.required_prefix = |
| 63 | +dotnet_naming_style.pascal_case.required_suffix = |
| 64 | +dotnet_naming_style.pascal_case.word_separator = |
| 65 | +dotnet_naming_style.pascal_case.capitalization = pascal_case |
| 66 | + |
| 67 | +dotnet_naming_style.pascal_case.required_prefix = |
| 68 | +dotnet_naming_style.pascal_case.required_suffix = |
| 69 | +dotnet_naming_style.pascal_case.word_separator = |
| 70 | +dotnet_naming_style.pascal_case.capitalization = pascal_case |
| 71 | +dotnet_style_operator_placement_when_wrapping = beginning_of_line |
| 72 | +tab_width = 4 |
| 73 | +indent_size = 4 |
| 74 | +end_of_line = crlf |
| 75 | +dotnet_style_coalesce_expression = true:suggestion |
| 76 | +dotnet_style_null_propagation = true:suggestion |
| 77 | +dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion |
| 78 | +dotnet_style_prefer_auto_properties = true:silent |
| 79 | +dotnet_style_object_initializer = true:suggestion |
| 80 | +dotnet_style_collection_initializer = true:suggestion |
| 81 | +dotnet_style_prefer_simplified_boolean_expressions = true:suggestion |
| 82 | +dotnet_style_prefer_conditional_expression_over_assignment = true:silent |
| 83 | +dotnet_style_prefer_conditional_expression_over_return = true:silent |
| 84 | + |
| 85 | +# Enforce WizardWrx.Cryptography namespace for cryptography classes |
| 86 | +[Core/Cryptography/*.cs] |
| 87 | + |
| 88 | +dotnet_naming_rule.cryptography_namespace_rule.symbols = cryptography_namespace_symbols |
| 89 | +dotnet_naming_rule.cryptography_namespace_rule.style = cryptography_namespace_style |
| 90 | +dotnet_naming_rule.cryptography_namespace_rule.severity = warning |
| 91 | + |
| 92 | +dotnet_naming_symbols.cryptography_namespace_symbols.applicable_kinds = namespace |
| 93 | +dotnet_naming_symbols.cryptography_namespace_symbols.applicable_accessibilities = * |
| 94 | +dotnet_naming_symbols.cryptography_namespace_symbols.required_prefix = WizardWrx.Cryptography |
| 95 | + |
| 96 | +dotnet_naming_style.cryptography_namespace_style.required_prefix = WizardWrx.Cryptography |
| 97 | +dotnet_naming_style.cryptography_namespace_style.capitalization = pascal_case |
| 98 | + |
| 99 | +# WizardWrx constant naming convention |
| 100 | +[*.cs] |
| 101 | + |
| 102 | +dotnet_naming_rule.constants_should_be_all_caps.severity = suggestion |
| 103 | +dotnet_naming_rule.constants_should_be_all_caps.symbols = constant_symbols |
| 104 | +dotnet_naming_rule.constants_should_be_all_caps.style = all_caps_style |
| 105 | + |
| 106 | +dotnet_naming_symbols.constant_symbols.applicable_kinds = field |
| 107 | +dotnet_naming_symbols.constant_symbols.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected |
| 108 | +dotnet_naming_symbols.constant_symbols.required_modifiers = const |
| 109 | + |
| 110 | +dotnet_naming_style.all_caps_style.capitalization = all_upper |
| 111 | +dotnet_naming_style.all_caps_style.word_separator = _ |
| 112 | + |
| 113 | +# Enforce PascalCase for enums |
| 114 | +[*.cs] |
| 115 | + |
| 116 | +dotnet_naming_rule.enums_should_be_pascal_case.severity = suggestion |
| 117 | +dotnet_naming_rule.enums_should_be_pascal_case.symbols = enum_symbols |
| 118 | +dotnet_naming_rule.enums_should_be_pascal_case.style = pascal_case |
| 119 | + |
| 120 | +dotnet_naming_symbols.enum_symbols.applicable_kinds = enum |
| 121 | +dotnet_naming_symbols.enum_symbols.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected |
| 122 | +dotnet_naming_symbols.enum_symbols.required_modifiers = |
| 123 | + |
| 124 | +dotnet_naming_style.pascal_case.capitalization = pascal_case |
| 125 | + |
| 126 | +# Enforce PascalCase for static classes |
| 127 | +[*.cs] |
| 128 | + |
| 129 | +dotnet_naming_rule.static_classes_should_be_pascal_case.severity = suggestion |
| 130 | +dotnet_naming_rule.static_classes_should_be_pascal_case.symbols = static_class_symbols |
| 131 | +dotnet_naming_rule.static_classes_should_be_pascal_case.style = pascal_case |
| 132 | + |
| 133 | +dotnet_naming_symbols.static_class_symbols.applicable_kinds = class |
| 134 | +dotnet_naming_symbols.static_class_symbols.required_modifiers = static |
| 135 | +dotnet_naming_symbols.static_class_symbols.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected |
| 136 | + |
| 137 | +dotnet_naming_style.pascal_case.capitalization = pascal_case |
| 138 | + |
| 139 | +# Methods must be PascalCase |
| 140 | +[*.cs] |
| 141 | + |
| 142 | +dotnet_naming_rule.methods_should_be_pascal_case.severity = suggestion |
| 143 | +dotnet_naming_rule.methods_should_be_pascal_case.symbols = method_symbols |
| 144 | +dotnet_naming_rule.methods_should_be_pascal_case.style = pascal_case |
| 145 | + |
| 146 | +dotnet_naming_symbols.method_symbols.applicable_kinds = method |
| 147 | +dotnet_naming_symbols.method_symbols.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected |
| 148 | +dotnet_naming_symbols.method_symbols.required_modifiers = |
| 149 | + |
| 150 | +dotnet_naming_style.pascal_case.capitalization = pascal_case |
| 151 | + |
| 152 | +# Parameters must use Hungarian notation (prefix p) |
| 153 | +[*.cs] |
| 154 | + |
| 155 | +dotnet_naming_rule.parameters_should_be_hungarian.severity = suggestion |
| 156 | +dotnet_naming_rule.parameters_should_be_hungarian.symbols = parameter_symbols |
| 157 | +dotnet_naming_rule.parameters_should_be_hungarian.style = hungarian_parameter_style |
| 158 | + |
| 159 | +dotnet_naming_symbols.parameter_symbols.applicable_kinds = parameter |
| 160 | +dotnet_naming_symbols.parameter_symbols.applicable_accessibilities = * |
| 161 | +dotnet_naming_symbols.parameter_symbols.required_modifiers = |
| 162 | + |
| 163 | +dotnet_naming_style.hungarian_parameter_style.required_prefix = p |
| 164 | +dotnet_naming_style.hungarian_parameter_style.capitalization = camel_case |
| 165 | + |
| 166 | +# Private instance fields must be Hungarian with _ prefix |
| 167 | +[*.cs] |
| 168 | + |
| 169 | +dotnet_naming_rule.private_fields_should_be_hungarian.severity = suggestion |
| 170 | +dotnet_naming_rule.private_fields_should_be_hungarian.symbols = private_field_symbols |
| 171 | +dotnet_naming_rule.private_fields_should_be_hungarian.style = hungarian_private_field_style |
| 172 | + |
| 173 | +dotnet_naming_symbols.private_field_symbols.applicable_kinds = field |
| 174 | +dotnet_naming_symbols.private_field_symbols.applicable_accessibilities = private |
| 175 | +dotnet_naming_symbols.private_field_symbols.required_modifiers = |
| 176 | + |
| 177 | +dotnet_naming_style.hungarian_private_field_style.required_prefix = _ |
| 178 | +dotnet_naming_style.hungarian_private_field_style.capitalization = camel_case |
| 179 | + |
| 180 | +# Private static fields must be Hungarian with s_ prefix |
| 181 | +[*.cs] |
| 182 | + |
| 183 | +dotnet_naming_rule.private_static_fields_should_be_hungarian.severity = suggestion |
| 184 | +dotnet_naming_rule.private_static_fields_should_be_hungarian.symbols = private_static_field_symbols |
| 185 | +dotnet_naming_rule.private_static_fields_should_be_hungarian.style = hungarian_private_static_field_style |
| 186 | + |
| 187 | +dotnet_naming_symbols.private_static_field_symbols.applicable_kinds = field |
| 188 | +dotnet_naming_symbols.private_static_field_symbols.applicable_accessibilities = private |
| 189 | +dotnet_naming_symbols.private_static_field_symbols.required_modifiers = static |
| 190 | + |
| 191 | +dotnet_naming_style.hungarian_private_static_field_style.required_prefix = s_ |
| 192 | +dotnet_naming_style.hungarian_private_static_field_style.capitalization = camel_case |
| 193 | + |
| 194 | +# Private members (non-fields) must be Hungarian with _ prefix |
| 195 | +[*.cs] |
| 196 | + |
| 197 | +dotnet_naming_rule.private_members_should_be_hungarian.severity = suggestion |
| 198 | +dotnet_naming_rule.private_members_should_be_hungarian.symbols = private_member_symbols |
| 199 | +dotnet_naming_rule.private_members_should_be_hungarian.style = hungarian_private_member_style |
| 200 | + |
| 201 | +dotnet_naming_symbols.private_member_symbols.applicable_kinds = property, event |
| 202 | +dotnet_naming_symbols.private_member_symbols.applicable_accessibilities = private |
| 203 | +dotnet_naming_symbols.private_member_symbols.required_modifiers = |
| 204 | + |
| 205 | +dotnet_naming_style.hungarian_private_member_style.required_prefix = _ |
| 206 | +dotnet_naming_style.hungarian_private_member_style.capitalization = pascal_case |
0 commit comments