Skip to content

Commit

Permalink
refactor: change serialization behavior of Cuid
Browse files Browse the repository at this point in the history
Signed-off-by: Alan Brault <alan.brault@visus.io>
  • Loading branch information
xaevik committed Nov 15, 2023
1 parent 5fd03ca commit 2b25fff
Show file tree
Hide file tree
Showing 24 changed files with 279 additions and 222 deletions.
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
8 changes: 4 additions & 4 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 @@ -37,7 +37,7 @@ jobs:
with:
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 \
Expand All @@ -58,5 +58,5 @@ jobs:
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

6 changes: 3 additions & 3 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,7 +25,7 @@ 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:
Expand Down
1 change: 1 addition & 0 deletions cuid.net.sln
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
Directory.Build.props = Directory.Build.props
.gitignore = .gitignore
global.json = global.json
.editorconfig = .editorconfig
EndProjectSection
EndProject
Global
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"sdk": {
"version": "8.0.0",
"rollForward": "latestFeature",
"allowPrerelease": true
"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

0 comments on commit 2b25fff

Please sign in to comment.