forked from natemcmaster/CommandLineUtils
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.editorconfig
78 lines (61 loc) · 4.07 KB
/
.editorconfig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
root = true
[*]
indent_style = space
trim_trailing_whitespace = true
insert_final_newline = true
[*.{xml,csproj,props,targets,config}]
indent_size = 2
[*.json]
indent_size = 2
[*.cs]
indent_size = 4
# Style I care about
csharp_style_expression_bodied_constructors = false : error
csharp_prefer_braces = true : error
dotnet_sort_system_directives_first = true : error
# Stuff that is usually best
csharp_style_inlined_variable_declaration = true : warning
csharp_style_var_elsewhere = true : warning
csharp_space_after_cast = true : warning
csharp_style_pattern_matching_over_as_with_null_check = true : warning
csharp_style_pattern_matching_over_is_with_cast_check = true : warning
csharp_style_var_for_built_in_types = true : warning
csharp_style_var_when_type_is_apparent = true : warning
csharp_new_line_before_catch = true : warning
csharp_new_line_before_else = true : warning
csharp_new_line_before_finally = true : warning
csharp_indent_case_contents = true : warning
csharp_new_line_before_open_brace = all
csharp_indent_switch_labels = true : warning
csharp_indent_labels = one_less_than_current
csharp_prefer_simple_default_expression = true : warning
# Good defaults, but not always
dotnet_style_object_initializer = true : suggestion
csharp_style_expression_bodied_indexers = true : suggestion
csharp_style_expression_bodied_accessors = true : suggestion
csharp_style_throw_expression = true : suggestion
# Naming styles
## Constants are PascalCase
dotnet_naming_style.pascal_case.capitalization = pascal_case
dotnet_naming_symbols.constants.applicable_kinds = *
dotnet_naming_symbols.constants.required_modifiers = const
dotnet_naming_rule.constants_should_be_pascale_case.symbols = constants
dotnet_naming_rule.constants_should_be_pascale_case.style = pascal_case
dotnet_naming_rule.constants_should_be_pascale_case.severity = error
## Private static fields start with s_
dotnet_naming_style.s_underscore_camel_case.required_prefix = s_
dotnet_naming_style.s_underscore_camel_case.capitalization = camel_case
dotnet_naming_symbols.private_static_fields.applicable_kinds = field
dotnet_naming_symbols.private_static_fields.applicable_accessibilities = private
dotnet_naming_symbols.private_static_fields.required_modifiers = static
dotnet_naming_rule.private_static_fields_should_be_underscore.symbols = private_static_fields
dotnet_naming_rule.private_static_fields_should_be_underscore.style = s_underscore_camel_case
dotnet_naming_rule.private_static_fields_should_be_underscore.severity = error
## Private fields are _camelCase
dotnet_naming_style.underscore_camel_case.required_prefix = _
dotnet_naming_style.underscore_camel_case.capitalization = camel_case
dotnet_naming_symbols.private_fields.applicable_kinds = field
dotnet_naming_symbols.private_fields.applicable_accessibilities = private
dotnet_naming_rule.private_fields_should_be_underscore.symbols = private_fields
dotnet_naming_rule.private_fields_should_be_underscore.style = underscore_camel_case
dotnet_naming_rule.private_fields_should_be_underscore.severity = error