Skip to content

Commit 1fa1113

Browse files
authored
Merge pull request #95 from json-api-dotnet/update-to-jadnc-v5-7-1
Update to JsonApiDotNetCore v5.7.1
2 parents 69f54ba + 8d465fd commit 1fa1113

File tree

114 files changed

+1601
-890
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+1601
-890
lines changed

.config/dotnet-tools.json

+8-5
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,25 @@
33
"isRoot": true,
44
"tools": {
55
"jetbrains.resharper.globaltools": {
6-
"version": "2024.1.6",
6+
"version": "2024.3.6",
77
"commands": [
88
"jb"
9-
]
9+
],
10+
"rollForward": false
1011
},
1112
"regitlint": {
1213
"version": "6.3.13",
1314
"commands": [
1415
"regitlint"
15-
]
16+
],
17+
"rollForward": false
1618
},
1719
"dotnet-reportgenerator-globaltool": {
18-
"version": "5.3.11",
20+
"version": "5.4.5",
1921
"commands": [
2022
"reportgenerator"
21-
]
23+
],
24+
"rollForward": false
2225
}
2326
}
2427
}

.editorconfig

+128-38
Original file line numberDiff line numberDiff line change
@@ -4,60 +4,125 @@ root = true
44
[*]
55
indent_style = space
66
indent_size = 4
7+
tab-width = 4
78
charset = utf-8
89
trim_trailing_whitespace = true
910
insert_final_newline = true
1011

11-
[*.{config,csproj,css,js,json,props,ruleset,xslt,html}]
12+
[*.{config,csproj,css,js,json,props,targets,xml,ruleset,xsd,xslt,html,yml,yaml}]
1213
indent_size = 2
14+
tab-width = 2
15+
max_line_length = 160
16+
17+
[*.{cs,cshtml,ascx,aspx}]
1318

14-
[*.{cs}]
1519
#### C#/.NET Coding Conventions ####
1620

21+
# Default severity for IDE* analyzers with category 'Style'
22+
# Note: specific rules below use severity silent, because Resharper code cleanup auto-fixes them.
23+
dotnet_analyzer_diagnostic.category-Style.severity = warning
24+
1725
# 'using' directive preferences
1826
dotnet_sort_system_directives_first = true
19-
csharp_using_directive_placement = outside_namespace:suggestion
27+
csharp_using_directive_placement = outside_namespace:silent
28+
# IDE0005: Remove unnecessary import
29+
dotnet_diagnostic.IDE0005.severity = silent
2030

2131
# Namespace declarations
22-
csharp_style_namespace_declarations = file_scoped:suggestion
32+
csharp_style_namespace_declarations = file_scoped:silent
33+
# IDE0160: Use block-scoped namespace
34+
dotnet_diagnostic.IDE0160.severity = silent
35+
# IDE0161: Use file-scoped namespace
36+
dotnet_diagnostic.IDE0161.severity = silent
2337

2438
# this. preferences
25-
dotnet_style_qualification_for_field = false:suggestion
26-
dotnet_style_qualification_for_property = false:suggestion
27-
dotnet_style_qualification_for_method = false:suggestion
28-
dotnet_style_qualification_for_event = false:suggestion
39+
dotnet_style_qualification_for_field = false:silent
40+
dotnet_style_qualification_for_property = false:silent
41+
dotnet_style_qualification_for_method = false:silent
42+
dotnet_style_qualification_for_event = false:silent
43+
# IDE0003: Remove this or Me qualification
44+
dotnet_diagnostic.IDE0003.severity = silent
45+
# IDE0009: Add this or Me qualification
46+
dotnet_diagnostic.IDE0009.severity = silent
2947

3048
# Language keywords vs BCL types preferences
31-
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
32-
dotnet_style_predefined_type_for_member_access = true:suggestion
49+
dotnet_style_predefined_type_for_locals_parameters_members = true:silent
50+
dotnet_style_predefined_type_for_member_access = true:silent
51+
# IDE0049: Use language keywords instead of framework type names for type references
52+
dotnet_diagnostic.IDE0049.severity = silent
3353

3454
# Modifier preferences
35-
dotnet_style_require_accessibility_modifiers = for_non_interface_members:suggestion
36-
csharp_preferred_modifier_order = public, private, protected, internal, new, static, abstract, virtual, sealed, readonly, override, extern, unsafe, volatile, async:suggestion
37-
csharp_style_pattern_local_over_anonymous_function = false:silent
55+
dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent
56+
# IDE0040: Add accessibility modifiers
57+
dotnet_diagnostic.IDE0040.severity = silent
58+
csharp_preferred_modifier_order = public, private, protected, internal, new, static, abstract, virtual, sealed, readonly, override, extern, unsafe, volatile, async:silent
59+
# IDE0036: Order modifiers
60+
dotnet_diagnostic.IDE0036.severity = silent
3861

3962
# Expression-level preferences
4063
dotnet_style_operator_placement_when_wrapping = end_of_line
41-
dotnet_style_prefer_auto_properties = true:suggestion
42-
dotnet_style_prefer_conditional_expression_over_assignment = true:suggestion
43-
dotnet_style_prefer_conditional_expression_over_return = true:suggestion
44-
csharp_style_unused_value_expression_statement_preference = discard_variable:suggestion
64+
dotnet_style_prefer_auto_properties = true:silent
65+
# IDE0032: Use auto property
66+
dotnet_diagnostic.IDE0032.severity = silent
67+
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
68+
# IDE0045: Use conditional expression for assignment
69+
dotnet_diagnostic.IDE0045.severity = silent
70+
dotnet_style_prefer_conditional_expression_over_return = true:silent
71+
# IDE0046: Use conditional expression for return
72+
dotnet_diagnostic.IDE0046.severity = silent
73+
csharp_style_unused_value_expression_statement_preference = discard_variable:silent
74+
# IDE0058: Remove unused expression value
75+
dotnet_diagnostic.IDE0058.severity = silent
76+
77+
# Collection expression preferences (note: partially turned off in Directory.Build.props)
78+
dotnet_style_prefer_collection_expression = when_types_exactly_match
4579

4680
# Parameter preferences
47-
dotnet_code_quality_unused_parameters = non_public:suggestion
81+
dotnet_code_quality_unused_parameters = non_public
82+
83+
# Local functions vs lambdas
84+
csharp_style_prefer_local_over_anonymous_function = false:silent
85+
# IDE0039: Use local function instead of lambda
86+
dotnet_diagnostic.IDE0039.severity = silent
4887

4988
# Expression-bodied members
50-
csharp_style_expression_bodied_accessors = true:suggestion
51-
csharp_style_expression_bodied_constructors = false:suggestion
52-
csharp_style_expression_bodied_indexers = true:suggestion
53-
csharp_style_expression_bodied_lambdas = true:suggestion
54-
csharp_style_expression_bodied_local_functions = false:suggestion
55-
csharp_style_expression_bodied_methods = false:suggestion
56-
csharp_style_expression_bodied_operators = false:suggestion
57-
csharp_style_expression_bodied_properties = true:suggestion
89+
csharp_style_expression_bodied_accessors = true:silent
90+
# IDE0027: Use expression body for accessors
91+
dotnet_diagnostic.IDE0027.severity = silent
92+
csharp_style_expression_bodied_constructors = false:silent
93+
# IDE0021: Use expression body for constructors
94+
dotnet_diagnostic.IDE0021.severity = silent
95+
csharp_style_expression_bodied_indexers = true:silent
96+
# IDE0026: Use expression body for indexers
97+
dotnet_diagnostic.IDE0026.severity = silent
98+
csharp_style_expression_bodied_lambdas = true:silent
99+
# IDE0053: Use expression body for lambdas
100+
dotnet_diagnostic.IDE0053.severity = silent
101+
csharp_style_expression_bodied_local_functions = false:silent
102+
# IDE0061: Use expression body for local functions
103+
dotnet_diagnostic.IDE0061.severity = silent
104+
csharp_style_expression_bodied_methods = false:silent
105+
# IDE0022: Use expression body for methods
106+
dotnet_diagnostic.IDE0022.severity = silent
107+
csharp_style_expression_bodied_operators = false:silent
108+
# IDE0023: Use expression body for conversion operators
109+
dotnet_diagnostic.IDE0023.severity = silent
110+
# IDE0024: Use expression body for operators
111+
dotnet_diagnostic.IDE0024.severity = silent
112+
csharp_style_expression_bodied_properties = true:silent
113+
# IDE0025: Use expression body for properties
114+
dotnet_diagnostic.IDE0025.severity = silent
115+
116+
# Member preferences (these analyzers are unreliable)
117+
# IDE0051: Remove unused private member
118+
dotnet_diagnostic.IDE0051.severity = silent
119+
# IDE0052: Remove unread private member
120+
dotnet_diagnostic.IDE0052.severity = silent
58121

59122
# Code-block preferences
60-
csharp_prefer_braces = true:suggestion
123+
csharp_prefer_braces = true:silent
124+
# IDE0011: Add braces
125+
dotnet_diagnostic.IDE0011.severity = silent
61126

62127
# Indentation preferences
63128
csharp_indent_case_contents_when_block = false
@@ -66,19 +131,44 @@ csharp_indent_case_contents_when_block = false
66131
csharp_preserve_single_line_statements = false
67132

68133
# 'var' usage preferences
69-
csharp_style_var_for_built_in_types = false:none
70-
csharp_style_var_when_type_is_apparent = true:none
71-
csharp_style_var_elsewhere = false:none
134+
csharp_style_var_for_built_in_types = false:silent
135+
csharp_style_var_when_type_is_apparent = true:silent
136+
csharp_style_var_elsewhere = false:silent
137+
# IDE0007: Use var instead of explicit type
138+
dotnet_diagnostic.IDE0007.severity = silent
139+
# IDE0008: Use explicit type instead of var
140+
dotnet_diagnostic.IDE0008.severity = silent
72141

73142
# Parentheses preferences
74-
dotnet_style_parentheses_in_arithmetic_binary_operators = never_if_unnecessary:suggestion
75-
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:suggestion
76-
dotnet_style_parentheses_in_relational_binary_operators = never_if_unnecessary:suggestion
77-
78-
# Expression value is never used
79-
dotnet_diagnostic.IDE0058.severity = none
80-
81-
#### Naming Style ####
143+
dotnet_style_parentheses_in_arithmetic_binary_operators = never_if_unnecessary:silent
144+
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
145+
dotnet_style_parentheses_in_relational_binary_operators = never_if_unnecessary:silent
146+
# IDE0047: Remove unnecessary parentheses
147+
dotnet_diagnostic.IDE0047.severity = silent
148+
# IDE0048: Add parentheses for clarity
149+
dotnet_diagnostic.IDE0048.severity = silent
150+
151+
# Switch preferences
152+
# IDE0010: Add missing cases to switch statement
153+
dotnet_diagnostic.IDE0010.severity = silent
154+
# IDE0072: Add missing cases to switch expression
155+
dotnet_diagnostic.IDE0072.severity = silent
156+
157+
# Null check preferences
158+
# IDE0029: Null check can be simplified
159+
dotnet_diagnostic.IDE0029.severity = silent
160+
# IDE0030: Null check can be simplified
161+
dotnet_diagnostic.IDE0030.severity = silent
162+
# IDE0270: Null check can be simplified
163+
dotnet_diagnostic.IDE0270.severity = silent
164+
165+
# JSON002: Probable JSON string detected
166+
dotnet_diagnostic.JSON002.severity = silent
167+
168+
# CA1062: Validate arguments of public methods
169+
dotnet_code_quality.CA1062.excluded_symbol_names = Accept|DefaultVisit|Visit*|Apply*
170+
171+
#### .NET Naming Style ####
82172

83173
dotnet_diagnostic.IDE1006.severity = warning
84174

.github/ISSUE_TEMPLATE/question.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ assignees: ''
88
---
99

1010
<!--
11-
Remember that no-one is getting paid to answer your question. You're basically asking other people to give up their time to help you out of the goodness of their heart – it's up to you to do all you can to make that as simple as possible, so read http://tinyurl.com/stack-checklist first.
11+
Remember that no-one is getting paid to answer your question. You're basically asking other people to give up their time to help you out of the goodness of their heart – it's up to you to do all you can to make that as simple as possible, so read https://tinyurl.com/stack-checklist first.
1212
-->
1313

1414
#### SUMMARY

.github/workflows/build.yml

+18-10
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ concurrency:
2121
cancel-in-progress: true
2222

2323
env:
24-
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
24+
DOTNET_NOLOGO: true
2525
DOTNET_CLI_TELEMETRY_OPTOUT: true
2626

2727
jobs:
@@ -41,8 +41,8 @@ jobs:
4141
uses: actions/setup-dotnet@v4
4242
with:
4343
dotnet-version: |
44-
6.0.x
45-
8.0.x
44+
8.0.*
45+
9.0.*
4646
- name: Show installed versions
4747
shell: pwsh
4848
run: |
@@ -66,14 +66,14 @@ jobs:
6666
$versionSuffix = $segments.Length -eq 1 ? '' : $segments[1..$($segments.Length - 1)] -join '-'
6767
6868
[xml]$xml = Get-Content Directory.Build.props
69-
$configuredVersionPrefix = $xml.Project.PropertyGroup.JsonApiDotNetCoreMongoDbVersionPrefix | Select-Object -First 1
69+
$configuredVersionPrefix = $xml.Project.PropertyGroup.VersionPrefix | Select-Object -First 1
7070
7171
if ($configuredVersionPrefix -ne $versionPrefix) {
7272
Write-Error "Version prefix from git release tag '$versionPrefix' does not match version prefix '$configuredVersionPrefix' stored in Directory.Build.props."
7373
# To recover from this:
7474
# - Delete the GitHub release
7575
# - Run: git push --delete origin the-invalid-tag-name
76-
# - Adjust JsonApiDotNetCoreVersionPrefix in Directory.Build.props, commit and push
76+
# - Adjust VersionPrefix in Directory.Build.props, commit and push
7777
# - Recreate the GitHub release
7878
}
7979
}
@@ -97,7 +97,7 @@ jobs:
9797
if: matrix.os == 'ubuntu-latest'
9898
env:
9999
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
100-
uses: codecov/codecov-action@v4
100+
uses: codecov/codecov-action@v5
101101
with:
102102
fail_ci_if_error: true
103103
verbose: true
@@ -128,8 +128,8 @@ jobs:
128128
uses: actions/setup-dotnet@v4
129129
with:
130130
dotnet-version: |
131-
6.0.x
132-
8.0.x
131+
8.0.*
132+
9.0.*
133133
- name: Git checkout
134134
uses: actions/checkout@v4
135135
- name: Restore tools
@@ -183,8 +183,8 @@ jobs:
183183
uses: actions/setup-dotnet@v4
184184
with:
185185
dotnet-version: |
186-
6.0.x
187-
8.0.x
186+
8.0.*
187+
9.0.*
188188
- name: Git checkout
189189
uses: actions/checkout@v4
190190
with:
@@ -234,6 +234,14 @@ jobs:
234234
run: |
235235
dotnet nuget add source --username 'json-api-dotnet' --password "$env:GITHUB_TOKEN" --store-password-in-clear-text --name 'github' 'https://nuget.pkg.github.com/json-api-dotnet/index.json'
236236
dotnet nuget push "$env:GITHUB_WORKSPACE/packages/*.nupkg" --api-key "$env:GITHUB_TOKEN" --source 'github'
237+
- name: Publish to feedz.io
238+
if: github.event_name == 'push' || github.event_name == 'release'
239+
env:
240+
FEEDZ_IO_API_KEY: ${{ secrets.FEEDZ_IO_API_KEY }}
241+
shell: pwsh
242+
run: |
243+
dotnet nuget add source --name 'feedz-io' 'https://f.feedz.io/json-api-dotnet/jsonapidotnetcore/nuget/index.json'
244+
dotnet nuget push "$env:GITHUB_WORKSPACE/packages/*.nupkg" --api-key "$env:FEEDZ_IO_API_KEY" --source 'feedz-io'
237245
- name: Publish to NuGet
238246
if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags/v')
239247
env:

.github/workflows/codeql.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ jobs:
2727
uses: actions/setup-dotnet@v4
2828
with:
2929
dotnet-version: |
30-
6.0.x
31-
8.0.x
30+
8.0.*
31+
9.0.*
3232
- name: Git checkout
3333
uses: actions/checkout@v4
3434
- name: Initialize CodeQL

Build.ps1

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
$versionSuffix="pre"
2-
31
function VerifySuccessExitCode {
42
if ($LastExitCode -ne 0) {
53
throw "Command failed with exit code $LastExitCode."
@@ -16,14 +14,14 @@ Remove-Item -Recurse -Force * -Include coverage.cobertura.xml
1614
dotnet tool restore
1715
VerifySuccessExitCode
1816

19-
dotnet build --configuration Release /p:VersionSuffix=$versionSuffix
17+
dotnet build --configuration Release
2018
VerifySuccessExitCode
2119

22-
dotnet test --no-build --configuration Release --collect:"XPlat Code Coverage"
20+
dotnet test --no-build --configuration Release --verbosity quiet --collect:"XPlat Code Coverage"
2321
VerifySuccessExitCode
2422

2523
dotnet reportgenerator -reports:**\coverage.cobertura.xml -targetdir:artifacts\coverage -filefilters:-*.g.cs
2624
VerifySuccessExitCode
2725

28-
dotnet pack --no-build --configuration Release --output artifacts/packages /p:VersionSuffix=$versionSuffix
26+
dotnet pack --no-build --configuration Release --output artifacts/packages
2927
VerifySuccessExitCode

0 commit comments

Comments
 (0)