-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.editorconfig
More file actions
114 lines (97 loc) · 6.6 KB
/
.editorconfig
File metadata and controls
114 lines (97 loc) · 6.6 KB
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# ┌───────────────────────────────────────────────────────────
# │ 1) Global config
# └───────────────────────────────────────────────────────────
root = true
[*]
# encoding
charset = utf-8
# whitespace & newlines
trim_trailing_whitespace = true
insert_final_newline = true
csharp_using_directive_placement = outside_namespace:warning
csharp_prefer_simple_using_statement = false:error
csharp_prefer_braces = false:error
csharp_style_namespace_declarations = file_scoped:error
csharp_style_prefer_method_group_conversion = true:silent
csharp_style_prefer_top_level_statements = false:error
csharp_style_prefer_primary_constructors = true:suggestion
csharp_prefer_system_threading_lock = true:suggestion
csharp_style_expression_bodied_methods = when_on_single_line:error
csharp_style_expression_bodied_constructors = when_on_single_line:silent
csharp_style_expression_bodied_operators = when_on_single_line:error
csharp_style_expression_bodied_properties = when_on_single_line:error
csharp_style_expression_bodied_indexers = true:silent
csharp_style_expression_bodied_accessors = true:silent
csharp_style_expression_bodied_lambdas = true:silent
csharp_style_expression_bodied_local_functions = false:silent
csharp_indent_labels = one_less_than_current
csharp_style_throw_expression = true:suggestion
csharp_style_prefer_null_check_over_type_check = true:suggestion
# ┌───────────────────────────────────────────────────────────
# │ 2) Formatting rules
# └───────────────────────────────────────────────────────────
[*.{cs,vb}]
file_header_template = ----------------------------------------------------------------------------\n <copyright file="{fileName}" company="SAP Team" author="Alireza Poodineh">\n Copyright © SAP Team\n Released under the MIT License. See LICENSE.md.\n </copyright>\n----------------------------------------------------------------------------
# indent
indent_style = space
indent_size = 4
# use expression-bodied members whenever possible
csharp_style_expression_bodied_methods = when_on_single_line:error
csharp_style_expression_bodied_properties = when_on_single_line:error
csharp_style_expression_bodied_ctors = when_on_single_line:error
csharp_style_expression_bodied_operators = when_on_single_line:error
# prefer `var` for built‐in types, require explicit for others
csharp_style_var_for_built_in_types = true:error
csharp_style_var_elsewhere = false:error
# spacing
csharp_space_before_semicolon = false:error
csharp_space_after_cast = false:error
# file‐scoped namespaces (C# 10+)
csharp_style_namespace_declarations = file_scoped:error
# ┌───────────────────────────────────────────────────────────
# │ 3) Naming conventions
# └───────────────────────────────────────────────────────────
dotnet_naming_rule.private_members_should_be_camel_case.severity = error
dotnet_naming_rule.private_members_should_be_camel_case.symbols = private_fields
dotnet_naming_rule.private_members_should_be_camel_case.style = camel_case_style
dotnet_naming_symbols.private_fields.applicable_kinds = field
dotnet_naming_symbols.private_fields.applicable_accessibilities = private
dotnet_naming_symbols.private_fields.required_modifiers = readonly
dotnet_naming_style.camel_case_style.capitalization = camel_case
# ┌───────────────────────────────────────────────────────────
# │ 4) Analyzer rule severities
# └───────────────────────────────────────────────────────────
# treat dead‐code warnings as errors
dotnet_diagnostic.CS0169.severity = error # unused private field
dotnet_diagnostic.CS0649.severity = error # unassigned field
# IDE0051: remove unused private members
dotnet_diagnostic.IDE0051.severity = error
# IDE0060: remove unused parameters
dotnet_diagnostic.IDE0060.severity = error
# require XML doc on public APIs
dotnet_diagnostic.CS1591.severity = error
# ┌───────────────────────────────────────────────────────────
# │ 5) Directive ordering & usings
# └───────────────────────────────────────────────────────────
dotnet_sort_system_directives_first = true:error
dotnet_separate_import_directive_groups = true:error
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_null_propagation = true:suggestion
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
dotnet_style_prefer_auto_properties = true:silent
dotnet_style_object_initializer = true:suggestion
dotnet_style_collection_initializer = true:suggestion
dotnet_style_operator_placement_when_wrapping = beginning_of_line
tab_width = 4
dotnet_style_prefer_simplified_boolean_expressions = true:warning
dotnet_style_prefer_conditional_expression_over_assignment = true:suggestion
dotnet_style_prefer_conditional_expression_over_return = true:suggestion
dotnet_style_explicit_tuple_names = true:suggestion
dotnet_style_prefer_inferred_tuple_names = true:suggestion
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
dotnet_style_prefer_compound_assignment = true:suggestion
dotnet_style_prefer_simplified_interpolation = true:suggestion
dotnet_style_prefer_collection_expression = when_types_loosely_match:suggestion
dotnet_style_namespace_match_folder = true:suggestion
# CA1510: Use ArgumentNullException throw helper
dotnet_diagnostic.CA1510.severity = none