Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: migrate to .net 8 #31

Merged
merged 3 commits into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 57 additions & 13 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
root = true
# Remove the line below if you want to inherit .editorconfig settings from higher directories

# All files
[*]

guidelines = 120
guidelines_style = 1px solid 40ff0000
root = true

# C# files
[*.cs]
Expand All @@ -18,8 +12,8 @@ indent_style = tab
tab_width = 4

# New line preferences
end_of_line = crlf
insert_final_newline = false
end_of_line = lf
insert_final_newline = true

#### .NET Coding Conventions ####

Expand Down Expand Up @@ -68,9 +62,9 @@ dotnet_code_quality_unused_parameters = all:suggestion
#### C# Coding Conventions ####

# var preferences
csharp_style_var_elsewhere = false:error
csharp_style_var_for_built_in_types = false:error
csharp_style_var_when_type_is_apparent = false:error
csharp_style_var_elsewhere = false:warning
csharp_style_var_for_built_in_types = false:warning
csharp_style_var_when_type_is_apparent = false:warning

# Expression-bodied members
csharp_style_expression_bodied_accessors = true
Expand Down Expand Up @@ -115,7 +109,6 @@ csharp_new_line_before_else = true
csharp_new_line_before_finally = true
csharp_new_line_before_members_in_anonymous_types = true
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_open_brace = all
csharp_new_line_between_query_expression_clauses = true

# Indentation preferences
Expand Down Expand Up @@ -153,3 +146,54 @@ csharp_space_between_square_brackets = false
# Wrapping preferences
csharp_preserve_single_line_blocks = true
csharp_preserve_single_line_statements = true

#### Resharper Formatting Rules ####

resharper_csharp_accessor_declaration_braces = next_line
resharper_csharp_accessor_owner_declaration_braces = next_line
resharper_csharp_align_first_arg_by_paren = true
resharper_csharp_align_linq_query = true
resharper_csharp_align_multiline_argument = true
resharper_csharp_align_multiline_array_and_object_initializer = false
resharper_csharp_align_multiline_binary_expressions_chain = true
resharper_csharp_align_multiline_binary_patterns = true
resharper_csharp_align_multiline_calls_chain = true
resharper_csharp_align_multiline_expression = true
resharper_csharp_align_multiline_extends_list = true
resharper_csharp_align_multiline_parameter = true
resharper_csharp_align_multiline_property_pattern = true
resharper_csharp_align_multiline_statement_conditions = true
resharper_csharp_align_multiline_switch_expression = false
resharper_csharp_align_multiple_declaration = true
resharper_csharp_align_multline_type_parameter_constrains = true
resharper_csharp_align_multline_type_parameter_list = true
resharper_csharp_align_tuple_components = true
resharper_csharp_alignment_tab_fill_style = optimal_fill
resharper_csharp_allow_far_alignment = true
resharper_csharp_brace_style = next_line
resharper_csharp_case_block_braces = next_line
resharper_csharp_continuous_indent_multiplier = 1
resharper_csharp_indent_anonymous_method_block = true
resharper_csharp_indent_braces_inside_statement_conditions = true
resharper_csharp_indent_inside_namespace = true
resharper_csharp_indent_nested_fixed_stmt = false
resharper_csharp_indent_nested_for_stmt = false
resharper_csharp_indent_nested_foreach_stmt = false
resharper_csharp_indent_nested_lock_stmt = false
resharper_csharp_indent_nested_usings_stmt = false
resharper_csharp_indent_nested_while_stmt = false
resharper_csharp_indent_preprocessor_if = no_indent
resharper_csharp_indent_preprocessor_other = usual_indent
resharper_csharp_indent_preprocessor_region = no_indent
resharper_csharp_indent_type_constraints = true
resharper_csharp_initializer_braces = next_line
resharper_csharp_invocable_declaration_braces = next_line
resharper_csharp_keep_existing_initializer_arrangement = false
resharper_csharp_max_initializer_elements_on_line = 1
resharper_csharp_other_braces = next_line
resharper_csharp_outdent_binary_ops = true
resharper_csharp_outdent_binary_pattern_ops = true
resharper_csharp_outdent_dots = true
resharper_csharp_place_simple_initializer_on_single_line = true
resharper_csharp_type_declaration_braces = next_line
resharper_csharp_wrap_object_and_collection_initializer_style = chop_always
21 changes: 14 additions & 7 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- main
paths-ignore:
- '**.md'
- '**/renovate.json'
- '**/renovate.json'
- '.github/workflows/release.yaml'
pull_request:
paths-ignore:
Expand All @@ -20,7 +20,7 @@ jobs:
env:
DOTNET_CLI_TELEMETRY_OPTOUT: true
DOTNET_NOLOGO: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -35,21 +35,28 @@ jobs:
- name: Install .NET SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
6.0.x
7.0.x
global-json-file: global.json
- name: Build
run: dotnet build -c release
run: dotnet build -c release
- name: Test
run: |
dotnet test -c release --no-restore --no-build \
--logger:trx \
--results-directory ${{ runner.temp }}/TestResults \
-p:CollectCoverage=true \
-p:CoverletOutputFormat=opencover \
-p:CoverletOutput=${{ runner.temp }}/coverage.opencover.xml
- name: Publish Test Results
uses: dorny/test-reporter@v1
if: success() || failure()
with:
name: Test Results
path: ${{ runner.temp }}/TestResults/*.trx
reporter: dotnet-trx
- name: Codacy Coverage
if: always()
uses: codacy/codacy-coverage-reporter-action@v1
with:
project-token: ${{ secrets.CODACY_TOKEN }}
coverage-reports: ${{ runner.temp }}/coverage.opencover.*.xml
coverage-reports: ${{ runner.temp }}/coverage.opencover.xml

10 changes: 4 additions & 6 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
push:
tags:
- '*'

jobs:
build:
name: Build, Analyze & Test
Expand All @@ -14,7 +14,7 @@ jobs:
DOTNET_CLI_TELEMETRY_OPTOUT: true
DOTNET_NOLOGO: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -25,13 +25,11 @@ jobs:
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: ${{ runner.os}}-nuget
restore-keys: ${{ runner.os}}-nuget
- name: Install .NET SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
6.0.x
7.0.x
global-json-file: global.json
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0.10.2
with:
Expand Down
2 changes: 2 additions & 0 deletions cuid.net.sln
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
renovate.json = renovate.json
Directory.Build.props = Directory.Build.props
.gitignore = .gitignore
global.json = global.json
.editorconfig = .editorconfig
EndProjectSection
EndProject
Global
Expand Down
4 changes: 3 additions & 1 deletion cuid.net.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -294,4 +294,6 @@
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpPlaceEmbeddedOnSameLineMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpUseContinuousIndentInsideBracesMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EAlwaysTreatStructAsNotReorderableMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateBlankLinesAroundFieldToBlankLinesAroundProperty/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateBlankLinesAroundFieldToBlankLinesAroundProperty/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Cuid/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Visus/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
7 changes: 7 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"sdk": {
"version": "8.0.0",
"rollForward": "latestFeature",
"allowPrerelease": false
}
}
70 changes: 35 additions & 35 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
{
"extends": [
"config:base",
":disableDependencyDashboard",
":gitSignOff"
],
"assigneesFromCodeOwners": true,
"packageRules": [
{
"matchPackagePatterns": [
"*"
],
"matchUpdateTypes": [
"minor",
"patch"
],
"groupName": "all non-major dependencies",
"groupSlug": "all-minor-patch",
"labels": [
"dependencies"
],
"automerge": true
},
{
"matchPackagePatterns": [
"*"
],
"matchUpdateTypes": [
"major"
],
"labels": [
"dependencies",
"breaking"
]
}
]
"extends": [
"config:base",
":disableDependencyDashboard",
":gitSignOff"
],
"assigneesFromCodeOwners": true,
"packageRules": [
{
"matchPackagePatterns": [
"*"
],
"matchUpdateTypes": [
"minor",
"patch"
],
"groupName": "all non-major dependencies",
"groupSlug": "all-minor-patch",
"labels": [
"dependencies"
],
"automerge": true
},
{
"matchPackagePatterns": [
"*"
],
"matchUpdateTypes": [
"major"
],
"labels": [
"dependencies",
"breaking"
]
}
]
}
2 changes: 1 addition & 1 deletion src/cuid.net/Abstractions/FingerprintVersion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ internal enum FingerprintVersion : byte
None = 0,
One = 1,
Two = 2
}
}
Loading