Skip to content

Commit 184c2de

Browse files
authored
refactor: Switched to NetEvolve.Defaults (#258)
* refactor: Switched to `NetEvolve.Defaults` * chore: Removed submodule `eng`
1 parent e9e4a58 commit 184c2de

9 files changed

+196
-32
lines changed

.editorconfig

Lines changed: 190 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,193 @@ indent_style = tab
8787
[*.{received,verified}.txt]
8888
insert_final_newline = false
8989
trim_trailing_whitespace = false
90+
91+
[*.{cs,csx,vb,vbx}]
92+
# .NET Code Style Settings
93+
# See https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference
94+
dotnet_sort_system_directives_first = true
95+
dotnet_separate_import_directive_groups = false
96+
97+
# Don't use 'this.'/'Me.' prefix for anything
98+
dotnet_style_qualification_for_field = false : error
99+
dotnet_style_qualification_for_property = false : error
100+
dotnet_style_qualification_for_method = false : error
101+
dotnet_style_qualification_for_event = false : error
102+
103+
# Use language keywords over framework type names for type references
104+
# i.e. prefer 'string' over 'String'
105+
dotnet_style_predefined_type_for_locals_parameters_members = true : error
106+
dotnet_style_predefined_type_for_member_access = true : error
107+
108+
# Prefer object/collection initializers
109+
# This is a suggestion because there are cases where this is necessary
110+
dotnet_style_object_initializer = true : warning
111+
dotnet_style_collection_initializer = true : warning
112+
113+
# C# 7: Prefer using named tuple names over '.Item1', '.Item2', etc.
114+
dotnet_style_explicit_tuple_names = true : error
115+
116+
# Prefer using 'foo ?? bar' over 'foo is not null ? foo : bar'
117+
dotnet_style_coalesce_expression = true : error
118+
119+
# Prefer using '?.' over ternary null checking where possible
120+
dotnet_style_null_propagation = true : error
121+
122+
# Modifier preferences
123+
# See https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-language-conventions?view=vs-2019#normalize-modifiers
124+
dotnet_style_require_accessibility_modifiers = always : error
125+
dotnet_style_readonly_field = true : warning
126+
127+
# Required Styles
128+
dotnet_naming_style.all_const.capitalization = pascal_case
129+
dotnet_naming_symbols.all_const.applicable_kinds = field
130+
dotnet_naming_symbols.all_const.required_modifiers = const
131+
dotnet_naming_rule.all_const.severity = error
132+
dotnet_naming_rule.all_const.style = all_elements
133+
dotnet_naming_rule.all_const.symbols = all_const
134+
135+
dotnet_naming_style.all_fields.required_prefix = _
136+
dotnet_naming_style.all_fields.capitalization = camel_case
137+
dotnet_naming_symbols.all_fields.applicable_kinds = field
138+
dotnet_naming_rule.all_fields.severity = error
139+
dotnet_naming_rule.all_fields.style = all_fields
140+
dotnet_naming_rule.all_fields.symbols = all_fields
141+
142+
dotnet_naming_style.all_interfaces.required_prefix = I
143+
dotnet_naming_style.all_interfaces.capitalization = pascal_case
144+
dotnet_naming_symbols.all_interfaces.applicable_kinds = interface
145+
dotnet_naming_rule.all_interfaces.severity = error
146+
dotnet_naming_rule.all_interfaces.style = all_interfaces
147+
dotnet_naming_rule.all_interfaces.symbols = all_interfaces
148+
149+
dotnet_naming_style.all_type_parameter.required_prefix = T
150+
dotnet_naming_style.all_type_parameter.capitalization = pascal_case
151+
dotnet_naming_symbols.all_type_parameter.applicable_kinds = type_parameter
152+
dotnet_naming_rule.all_type_parameter.severity = error
153+
dotnet_naming_rule.all_type_parameter.style = all_type_parameter
154+
dotnet_naming_rule.all_type_parameter.symbols = all_type_parameter
155+
156+
dotnet_naming_style.abstract_class.required_suffix = Base
157+
dotnet_naming_style.abstract_class.capitalization = pascal_case
158+
dotnet_naming_symbols.abstract_class.applicable_kinds = class
159+
dotnet_naming_symbols.abstract_class.required_modifiers = abstract
160+
dotnet_naming_rule.abstract_class.severity = warning
161+
dotnet_naming_rule.abstract_class.style = abstract_class
162+
dotnet_naming_rule.abstract_class.symbols = abstract_class
163+
164+
dotnet_naming_style.method_async.required_suffix = Async
165+
dotnet_naming_style.method_async.capitalization = pascal_case
166+
dotnet_naming_symbols.method_async.applicable_kinds = method
167+
dotnet_naming_symbols.method_async.required_modifiers = async
168+
dotnet_naming_rule.method_async.severity = warning
169+
dotnet_naming_rule.method_async.style = method_async
170+
dotnet_naming_rule.method_async.symbols = method_async
171+
172+
dotnet_naming_style.all_elements.capitalization = pascal_case
173+
dotnet_naming_symbols.all_elements.applicable_kinds = namespace,class,struct,enum,property,method,event,delegate,local_function
174+
dotnet_naming_rule.all_elements.severity = error
175+
dotnet_naming_rule.all_elements.style = all_elements
176+
dotnet_naming_rule.all_elements.symbols = all_elements
177+
178+
dotnet_naming_style.all_parameters.capitalization = camel_case
179+
dotnet_naming_symbols.all_parameters.applicable_kinds = parameter,local
180+
dotnet_naming_rule.all_parameters.severity = error
181+
dotnet_naming_rule.all_parameters.style = all_parameters
182+
dotnet_naming_rule.all_parameters.symbols = all_parameters
183+
184+
dotnet_style_operator_placement_when_wrapping = beginning_of_line
185+
dotnet_style_prefer_is_null_check_over_reference_equality_method = true : suggestion
186+
dotnet_style_prefer_auto_properties = true : silent
187+
188+
# Placement for using directives
189+
csharp_using_directive_placement = inside_namespace : warning
190+
191+
# Use 'var' in all cases where it can be used
192+
csharp_style_var_for_built_in_types = true : error
193+
csharp_style_var_when_type_is_apparent = true : error
194+
csharp_style_var_elsewhere = true : error
195+
196+
# Unused value preferences
197+
csharp_style_unused_value_expression_statement_preference = discard_variable : warning
198+
csharp_style_unused_value_assignment_preference = discard_variable : warning
199+
200+
# C# 7: Prefer using pattern matching over "if(x is T) { var t = (T)x; }" and "var t = x as T; if(t is not null) { ... }"
201+
csharp_style_pattern_matching_over_is_with_cast_check = true : warning
202+
csharp_style_pattern_matching_over_as_with_null_check = true : warning
203+
204+
# C# 7: Prefer using 'out var' where possible
205+
csharp_style_inlined_variable_declaration = true : error
206+
207+
# C# 7: Use throw expressions when null-checking
208+
csharp_style_throw_expression = false : error
209+
210+
# Prefer using "func?.Invoke(args)" over "if(func is not null) { func(args); }"
211+
csharp_style_conditional_delegate_call = true : error
212+
213+
# Newline settings
214+
csharp_indent_braces = false
215+
csharp_open_brace_on_new_line = all
216+
csharp_new_line_before_open_brace = all
217+
csharp_new_line_before_else = true
218+
csharp_new_line_before_catch = true
219+
csharp_new_line_before_finally = true
220+
csharp_new_line_before_members_in_object_initializers = true
221+
csharp_new_line_before_members_in_anonymous_types = true
222+
223+
# Prefer expression-bodied methods, constructors, operators, etc.
224+
csharp_style_expression_bodied_methods = true : warning
225+
csharp_style_expression_bodied_constructors = true : warning
226+
csharp_style_expression_bodied_operators = true : warning
227+
csharp_style_expression_bodied_properties = true : warning
228+
csharp_style_expression_bodied_indexers = true : warning
229+
csharp_style_expression_bodied_accessors = true : warning
230+
231+
# Prefer Braces even for one line of code, because of
232+
csharp_prefer_braces = true : error
233+
csharp_type_declaration_braces = next_line
234+
csharp_invocable_declaration_braces = next_line
235+
csharp_anonymous_method_declaration_braces = next_line
236+
csharp_accessor_owner_declaration_braces = next_line
237+
csharp_accessor_declaration_braces = next_line
238+
csharp_case_block_braces = next_line
239+
csharp_initializer_braces = next_line
240+
csharp_other_braces = next_line
241+
242+
# Tuple Preferences
243+
csharp_style_deconstructed_variable_declaration = true : warning
244+
245+
# Simplify new expression (IDE0090)
246+
csharp_style_implicit_object_creation_when_type_is_apparent = false
247+
csharp_style_namespace_declarations = file_scoped : warning
248+
csharp_prefer_simple_using_statement = false : suggestion
249+
csharp_indent_labels = one_less_than_current
250+
csharp_style_expression_bodied_lambdas = true : silent
251+
csharp_style_expression_bodied_local_functions = false : silent
252+
253+
# Use Compound assignment
254+
dotnet_style_prefer_compound_assignment = false
255+
256+
# Prefer if-else statement
257+
dotnet_style_prefer_conditional_expression_over_return = false
258+
dotnet_diagnostic.IDE0046.severity = suggestion
259+
260+
# Prefer standard constructors
261+
csharp_style_prefer_primary_constructors = false
262+
dotnet_diagnostic.IDE0290.severity = suggestion
263+
264+
# [CSharpier] Incompatible rules deactivated
265+
# https://csharpier.com/docs/IntegratingWithLinters#code-analysis-rules
266+
dotnet_diagnostic.IDE0055.severity = none
267+
dotnet_diagnostic.SA1000.severity = none
268+
dotnet_diagnostic.SA1009.severity = none
269+
dotnet_diagnostic.SA1111.severity = none
270+
dotnet_diagnostic.SA1118.severity = none
271+
dotnet_diagnostic.SA1137.severity = none
272+
dotnet_diagnostic.SA1413.severity = none
273+
dotnet_diagnostic.SA1500.severity = none
274+
dotnet_diagnostic.SA1501.severity = none
275+
dotnet_diagnostic.SA1502.severity = none
276+
dotnet_diagnostic.SA1504.severity = none
277+
dotnet_diagnostic.SA1515.severity = none
278+
dotnet_diagnostic.SA1516.severity = none
279+

.gitmodules

Lines changed: 0 additions & 4 deletions
This file was deleted.

Directory.Build.props

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
11
<Project>
22

3-
<PropertyGroup>
4-
<DirEngineering>$([MSBuild]::NormalizeDirectory('$(MSBuildThisFileDirectory)', 'eng'))</DirEngineering>
5-
<DirEngineeringSettings>$([MSBuild]::NormalizeDirectory('$(DirEngineering)', 'settings'))</DirEngineeringSettings>
6-
</PropertyGroup>
7-
8-
<Import Project="$(DirEngineeringSettings)sln.build.props" />
9-
<Import Project="$(DirEngineeringSettings)src.build.props" Condition=" '$(IsTestableProject)' != 'true' " />
10-
<Import Project="$(DirEngineeringSettings)tests.build.props" Condition=" '$(IsTestableProject)' == 'true' " />
11-
123
<PropertyGroup>
134
<!-- Workaround, until https://github.com/GitTools/GitVersion/pull/4206 is released -->
145
<GitVersionTargetFramework>net8.0</GitVersionTargetFramework>

Directory.Build.targets

Lines changed: 0 additions & 7 deletions
This file was deleted.

Directory.Packages.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<GlobalPackageReference Include="Microsoft.CodeAnalysis.BannedApiAnalyzers" Version="3.3.4" />
1010
<GlobalPackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="9.0.0" />
1111
<GlobalPackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
12-
<GlobalPackageReference Include="NetEvolve.Defaults" Version="1.2.1" />
12+
<GlobalPackageReference Include="NetEvolve.Defaults" Version="1.3.9" />
1313
<GlobalPackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.12.19" />
1414
</ItemGroup>
1515
<ItemGroup>

Directory.Solution.props

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
<Project>
2-
32
<PropertyGroup>
4-
<DirEngineering>$([MSBuild]::NormalizeDirectory('$(MSBuildThisFileDirectory)', 'eng'))</DirEngineering>
5-
<DirEngineeringSettings>$([MSBuild]::NormalizeDirectory('$(DirEngineering)', 'settings'))</DirEngineeringSettings>
3+
<!-- For solution restore, msbuild doesn't honor the property set in Directory.Build.props. -->
4+
<RestoreUseStaticGraphEvaluation>true</RestoreUseStaticGraphEvaluation>
65
</PropertyGroup>
7-
8-
<Import Project="$(DirEngineeringSettings)sln.solution.props" />
9-
106
</Project>

Extensions.Tasks.sln

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
1111
.gitignore = .gitignore
1212
.gitmodules = .gitmodules
1313
Directory.Build.props = Directory.Build.props
14-
Directory.Build.targets = Directory.Build.targets
1514
Directory.Packages.props = Directory.Packages.props
1615
Directory.Solution.props = Directory.Solution.props
1716
GitVersion.yml = GitVersion.yml
@@ -35,9 +34,6 @@ Global
3534
Debug|Any CPU = Debug|Any CPU
3635
Release|Any CPU = Release|Any CPU
3736
EndGlobalSection
38-
GlobalSection(SolutionProperties) = preSolution
39-
HideSolutionNode = FALSE
40-
EndGlobalSection
4137
GlobalSection(ProjectConfigurationPlatforms) = postSolution
4238
{32A5B638-F470-49B4-A31E-F70D99A5DE6B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
4339
{32A5B638-F470-49B4-A31E-F70D99A5DE6B}.Debug|Any CPU.Build.0 = Debug|Any CPU
@@ -48,6 +44,9 @@ Global
4844
{69E45641-51C4-4708-8F10-9AE297C34235}.Release|Any CPU.ActiveCfg = Release|Any CPU
4945
{69E45641-51C4-4708-8F10-9AE297C34235}.Release|Any CPU.Build.0 = Release|Any CPU
5046
EndGlobalSection
47+
GlobalSection(SolutionProperties) = preSolution
48+
HideSolutionNode = FALSE
49+
EndGlobalSection
5150
GlobalSection(NestedProjects) = preSolution
5251
{32A5B638-F470-49B4-A31E-F70D99A5DE6B} = {DD5E93D8-B646-4133-88CE-E37C05013D7C}
5352
{69E45641-51C4-4708-8F10-9AE297C34235} = {A15FBA8C-C726-421D-BF95-9049DCA65D35}

eng

Lines changed: 0 additions & 1 deletion
This file was deleted.

logo.png

-28.6 KB
Loading

0 commit comments

Comments
 (0)