Skip to content

Commit 437c8ad

Browse files
authored
Migrate to .NET 8 (#37)
1 parent 93512d3 commit 437c8ad

File tree

12 files changed

+159
-225
lines changed

12 files changed

+159
-225
lines changed

.editorconfig

Lines changed: 75 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -1,129 +1,91 @@
1-
# To learn more about .editorconfig see https://aka.ms/editorconfigdocs
2-
###############################
3-
# Core EditorConfig Options #
4-
###############################
5-
# All files
1+
# editorconfig.org
2+
root = true
3+
64
[*]
5+
charset = utf-8
76
end_of_line = lf
7+
indent_size = 2
88
indent_style = space
99
insert_final_newline = true
10-
indent_size = 2
1110
trim_trailing_whitespace = true
1211

13-
# XML project files
14-
[*.{csproj,proj,projitems,shproj}]
15-
indent_size = 2
16-
17-
# XML config files
18-
[*.{props,targets,ruleset,config,nuspec,resx}]
19-
indent_size = 2
12+
file_header_template = SPDX-FileCopyrightText: 2023 Demerzel Solutions Limited\nSPDX-License-Identifier: LGPL-3.0-only
2013

21-
# Code files
22-
[*.{cs,csx}]
23-
indent_size = 4
24-
insert_final_newline = true
25-
charset = utf-8-bom
26-
###############################
27-
# .NET Coding Conventions #
28-
###############################
2914
[*.cs]
30-
# Organize usings
31-
dotnet_sort_system_directives_first = true
32-
# this. preferences
33-
dotnet_style_qualification_for_field = false:silent
34-
dotnet_style_qualification_for_property = false:silent
35-
dotnet_style_qualification_for_method = false:silent
36-
dotnet_style_qualification_for_event = false:silent
37-
# Language keywords vs BCL types preferences
38-
dotnet_style_predefined_type_for_locals_parameters_members = true:silent
39-
dotnet_style_predefined_type_for_member_access = true:silent
40-
# Parentheses preferences
41-
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
42-
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent
43-
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
44-
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
45-
# Modifier preferences
46-
dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent
47-
dotnet_style_readonly_field = true:suggestion
48-
# Expression-level preferences
49-
dotnet_style_object_initializer = true:suggestion
50-
dotnet_style_collection_initializer = true:suggestion
51-
dotnet_style_explicit_tuple_names = true:suggestion
52-
dotnet_style_null_propagation = true:suggestion
15+
indent_size = 4
16+
17+
#### Naming styles ####
18+
19+
# Naming rules
20+
21+
dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion
22+
dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
23+
dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i
24+
25+
dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion
26+
dotnet_naming_rule.types_should_be_pascal_case.symbols = types
27+
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case
28+
29+
dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion
30+
dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
31+
dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case
32+
33+
# Symbol specifications
34+
35+
dotnet_naming_symbols.interface.applicable_kinds = interface
36+
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
37+
dotnet_naming_symbols.interface.required_modifiers =
38+
39+
dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
40+
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
41+
dotnet_naming_symbols.types.required_modifiers =
42+
43+
dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
44+
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
45+
dotnet_naming_symbols.non_field_members.required_modifiers =
46+
47+
# Naming styles
48+
49+
dotnet_naming_style.begins_with_i.required_prefix = I
50+
dotnet_naming_style.begins_with_i.required_suffix =
51+
dotnet_naming_style.begins_with_i.word_separator =
52+
dotnet_naming_style.begins_with_i.capitalization = pascal_case
53+
54+
dotnet_naming_style.pascal_case.required_prefix =
55+
dotnet_naming_style.pascal_case.required_suffix =
56+
dotnet_naming_style.pascal_case.word_separator =
57+
dotnet_naming_style.pascal_case.capitalization = pascal_case
58+
59+
dotnet_naming_style.pascal_case.required_prefix =
60+
dotnet_naming_style.pascal_case.required_suffix =
61+
dotnet_naming_style.pascal_case.word_separator =
62+
dotnet_naming_style.pascal_case.capitalization = pascal_case
63+
dotnet_style_operator_placement_when_wrapping = beginning_of_line
5364
dotnet_style_coalesce_expression = true:suggestion
54-
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:silent
55-
dotnet_style_prefer_inferred_tuple_names = true:suggestion
56-
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
65+
dotnet_style_null_propagation = true:suggestion
66+
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
5767
dotnet_style_prefer_auto_properties = true:silent
58-
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
59-
dotnet_style_prefer_conditional_expression_over_return = true:silent
60-
###############################
61-
# Naming Conventions #
62-
###############################
63-
# Style Definitions
64-
dotnet_naming_style.pascal_case_style.capitalization = pascal_case
65-
# Use PascalCase for constant fields
66-
dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion
67-
dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields
68-
dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style
69-
dotnet_naming_symbols.constant_fields.applicable_kinds = field
70-
dotnet_naming_symbols.constant_fields.applicable_accessibilities = *
71-
dotnet_naming_symbols.constant_fields.required_modifiers = const
72-
###############################
73-
# C# Coding Conventions #
74-
###############################
75-
# var preferences
76-
csharp_style_var_for_built_in_types = true:silent
77-
csharp_style_var_when_type_is_apparent = true:silent
78-
csharp_style_var_elsewhere = true:silent
79-
# Expression-bodied members
68+
dotnet_style_object_initializer = true:suggestion
69+
dotnet_style_prefer_collection_expression = true:suggestion
70+
dotnet_style_collection_initializer = true:suggestion
71+
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
72+
73+
csharp_indent_labels = one_less_than_current
74+
csharp_using_directive_placement = outside_namespace:silent
75+
csharp_prefer_simple_using_statement = true:suggestion
76+
csharp_prefer_braces = when_multiline:suggestion
77+
csharp_style_namespace_declarations = file_scoped:suggestion
78+
csharp_style_prefer_method_group_conversion = true:silent
79+
csharp_style_prefer_top_level_statements = true:silent
80+
csharp_style_prefer_primary_constructors = true:suggestion
8081
csharp_style_expression_bodied_methods = false:silent
8182
csharp_style_expression_bodied_constructors = false:silent
8283
csharp_style_expression_bodied_operators = false:silent
8384
csharp_style_expression_bodied_properties = true:silent
8485
csharp_style_expression_bodied_indexers = true:silent
8586
csharp_style_expression_bodied_accessors = true:silent
86-
# Pattern matching preferences
87-
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
88-
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
89-
# Null-checking preferences
90-
csharp_style_throw_expression = true:suggestion
91-
csharp_style_conditional_delegate_call = true:suggestion
92-
# Modifier preferences
93-
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:suggestion
94-
# Expression-level preferences
95-
csharp_prefer_braces = true:silent
96-
csharp_style_deconstructed_variable_declaration = true:suggestion
97-
csharp_prefer_simple_default_expression = true:suggestion
98-
csharp_style_pattern_local_over_anonymous_function = true:suggestion
99-
csharp_style_inlined_variable_declaration = true:suggestion
100-
###############################
101-
# C# Formatting Rules #
102-
###############################
103-
# New line preferences
104-
csharp_new_line_before_open_brace = all
105-
csharp_new_line_before_else = true
106-
csharp_new_line_before_catch = true
107-
csharp_new_line_before_finally = true
108-
csharp_new_line_before_members_in_object_initializers = true
109-
csharp_new_line_before_members_in_anonymous_types = true
110-
csharp_new_line_between_query_expression_clauses = true
111-
# Indentation preferences
112-
csharp_indent_case_contents = true
113-
csharp_indent_switch_labels = true
114-
csharp_indent_labels = flush_left
115-
# Space preferences
116-
csharp_space_after_cast = false
117-
csharp_space_after_keywords_in_control_flow_statements = true
118-
csharp_space_between_method_call_parameter_list_parentheses = false
119-
csharp_space_between_method_declaration_parameter_list_parentheses = false
120-
csharp_space_between_parentheses = false
121-
csharp_space_before_colon_in_inheritance_clause = true
122-
csharp_space_after_colon_in_inheritance_clause = true
123-
csharp_space_around_binary_operators = before_and_after
124-
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
125-
csharp_space_between_method_call_name_and_opening_parenthesis = false
126-
csharp_space_between_method_call_empty_parameter_list_parentheses = false
127-
# Wrapping preferences
128-
csharp_preserve_single_line_statements = true
129-
csharp_preserve_single_line_blocks = true
87+
csharp_style_expression_bodied_lambdas = true:silent
88+
csharp_style_expression_bodied_local_functions = false:silent
89+
csharp_style_var_for_built_in_types = true:silent
90+
csharp_style_var_when_type_is_apparent = true:suggestion
91+
csharp_style_var_elsewhere = false:suggestion

.gitattributes

Lines changed: 1 addition & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1 @@
1-
###############################################################################
2-
# Set default behavior to automatically normalize line endings.
3-
###############################################################################
4-
* text=auto eol=lf
5-
6-
###############################################################################
7-
# Set default behavior for command prompt diff.
8-
#
9-
# This is need for earlier builds of msysgit that does not have it on by
10-
# default for csharp files.
11-
# Note: This is only used by command line
12-
###############################################################################
13-
#*.cs diff=csharp
14-
15-
###############################################################################
16-
# Set the merge driver for project and solution files
17-
#
18-
# Merging from the command prompt will add diff markers to the files if there
19-
# are conflicts (Merging from VS is not affected by the settings below, in VS
20-
# the diff markers are never inserted). Diff markers may cause the following
21-
# file extensions to fail to load in VS. An alternative would be to treat
22-
# these files as binary and thus will always conflict and require user
23-
# intervention with every merge. To do so, just uncomment the entries below
24-
###############################################################################
25-
#*.sln merge=binary
26-
#*.csproj merge=binary
27-
#*.vbproj merge=binary
28-
#*.vcxproj merge=binary
29-
#*.vcproj merge=binary
30-
#*.dbproj merge=binary
31-
#*.fsproj merge=binary
32-
#*.lsproj merge=binary
33-
#*.wixproj merge=binary
34-
#*.modelproj merge=binary
35-
#*.sqlproj merge=binary
36-
#*.wwaproj merge=binary
37-
38-
###############################################################################
39-
# behavior for image files
40-
#
41-
# image files are treated as binary by default.
42-
###############################################################################
43-
#*.jpg binary
44-
#*.png binary
45-
#*.gif binary
46-
47-
###############################################################################
48-
# diff behavior for common document formats
49-
#
50-
# Convert binary document formats to text before diffing them. This feature
51-
# is only available from the command line. Turn it on by uncommenting the
52-
# entries below.
53-
###############################################################################
54-
#*.doc diff=astextplain
55-
#*.DOC diff=astextplain
56-
#*.docx diff=astextplain
57-
#*.DOCX diff=astextplain
58-
#*.dot diff=astextplain
59-
#*.DOT diff=astextplain
60-
#*.pdf diff=astextplain
61-
#*.PDF diff=astextplain
62-
#*.rtf diff=astextplain
63-
#*.RTF diff=astextplain
1+
* text=auto eol=lf working-tree-encoding=utf-8

.github/workflows/publish.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: Publish
22

33
on:
4+
release:
5+
types: [published]
46
workflow_dispatch:
57

68
jobs:
@@ -12,20 +14,18 @@ jobs:
1214
steps:
1315

1416
- name: Check out repository
15-
uses: actions/checkout@v3
17+
uses: actions/checkout@v4
1618

1719
- name: Set up .NET
1820
uses: actions/setup-dotnet@v3
19-
with:
20-
dotnet-version: 7
2121

2222
- name: Install dependencies
2323
working-directory: src
2424
run: dotnet restore
2525

2626
- name: Build
2727
working-directory: src/Nethermind.Int256
28-
run: dotnet build -c ${{ env.BUILD_CONFIG }} --no-restore -p:ContinuousIntegrationBuild=true
28+
run: dotnet build -c ${{ env.BUILD_CONFIG }} --no-restore -p:Commit=$GITHUB_SHA
2929

3030
- name: Test
3131
working-directory: src/Nethermind.Int256.Test

.github/workflows/test.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,10 @@ jobs:
2222
DOTNET_EnableHWIntrinsic: ${{ matrix.hardware-intrinsics }}
2323
steps:
2424
- name: Check out repository
25-
uses: actions/checkout@v3
25+
uses: actions/checkout@v4
2626

2727
- name: Set up .NET
2828
uses: actions/setup-dotnet@v3
29-
with:
30-
dotnet-version: 7
3129

3230
- name: Test
3331
working-directory: src/Nethermind.Int256.Test

.gitignore

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ $tf/
131131
_ReSharper*/
132132
*.[Rr]e[Ss]harper
133133
*.DotSettings.user
134-
*.DotSettings
135134

136135
# TeamCity is a build add-in
137136
_TeamCity*
@@ -379,10 +378,10 @@ FodyWeavers.xsd
379378

380379
# VS Code files for those working on multiple tools
381380
.vscode/*
382-
!.vscode/settings.json
383-
!.vscode/tasks.json
384-
!.vscode/launch.json
385-
!.vscode/extensions.json
381+
#!.vscode/settings.json
382+
#!.vscode/tasks.json
383+
#!.vscode/launch.json
384+
#!.vscode/extensions.json
386385
*.code-workspace
387386

388387
# Local History for Visual Studio Code
@@ -396,5 +395,8 @@ FodyWeavers.xsd
396395
*.msp
397396

398397
# JetBrains Rider
399-
.idea/
400398
*.sln.iml
399+
.idea/
400+
401+
## macOS
402+
.DS_Store

global.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"sdk": {
3+
"version": "8.0.0",
4+
"allowPrerelease": false,
5+
"rollForward": "latestFeature"
6+
}
7+
}

src/Directory.Build.props

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<Project>
2+
3+
<PropertyGroup>
4+
<Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
5+
<ContinuousIntegrationBuild Condition="'$(CI)' == 'true'">true</ContinuousIntegrationBuild>
6+
<LangVersion>latest</LangVersion>
7+
<Nullable>enable</Nullable>
8+
<TargetFramework>net8.0</TargetFramework>
9+
</PropertyGroup>
10+
11+
<PropertyGroup Label="ProductInfo">
12+
<Authors>Nethermind</Authors>
13+
<Copyright>Demerzel Solutions Limited</Copyright>
14+
<SourceRevisionId Condition="'$(Commit)' != ''">$(Commit.Substring(0, 8))</SourceRevisionId>
15+
<VersionPrefix>1.2.0</VersionPrefix>
16+
<VersionSuffix></VersionSuffix>
17+
</PropertyGroup>
18+
19+
</Project>

src/Directory.Packages.props

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<Project>
2+
<PropertyGroup>
3+
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
4+
</PropertyGroup>
5+
<ItemGroup>
6+
<PackageVersion Include="BenchmarkDotNet" Version="0.13.11" />
7+
<PackageVersion Include="FluentAssertions" Version="6.12.0" />
8+
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
9+
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
10+
<PackageVersion Include="NUnit" Version="4.0.1" />
11+
<PackageVersion Include="NUnit.Analyzers" Version="3.10.0" />
12+
<PackageVersion Include="NUnit3TestAdapter" Version="4.5.0" />
13+
</ItemGroup>
14+
</Project>

0 commit comments

Comments
 (0)