Skip to content

Commit 01c165c

Browse files
committed
QOL improvements
1 parent 2662264 commit 01c165c

10 files changed

Lines changed: 67 additions & 798 deletions

.github/workflows/create-release.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,6 @@ name: Create Release
33
on:
44
workflow_dispatch:
55
inputs:
6-
version_type:
7-
type: choice
8-
description: Semantic Version Type
9-
options:
10-
- automatic
11-
- patch
12-
- minor
13-
- major
14-
156
pre_release:
167
type: choice
178
description: Stage
@@ -20,6 +11,15 @@ on:
2011
- rc
2112
- beta
2213
- alpha
14+
15+
version_type:
16+
type: choice
17+
description: Semantic Version Type
18+
options:
19+
- automatic
20+
- patch
21+
- minor
22+
- major
2323

2424
jobs:
2525
release-it:

.release-it.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"filename": "CHANGELOG.md",
1515
"addVersionUrl": true,
1616
"addUnreleased": true,
17-
"strictLatest": true
17+
"strictLatest": false
1818
}
1919
},
2020
"hooks": {

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ and adheres to a project-specific [Versioning](/README.md).
1111

1212
### Changed
1313

14-
- Stopped changing all rules to error first and instead use the default rulesets of the Analyzers as the base ru
14+
- Stopped changing all rules to error first and instead use the default rulesets of the Analyzers as the base rules
1515
- Migrate from \*.ruleset files to \*.globalconfig files
1616
- Migrate from \*.targets to \*. props files
1717
- Simplified and decluttered README file

Neolution.CodeAnalysis.TestsRuleset.nuspec

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
</metadata>
1919
<files>
2020
<file src="build\Neolution.CodeAnalysis.TestsRuleset.props" target="build\Neolution.CodeAnalysis.TestsRuleset.props" />
21-
<file src="build\Neolution.Tests.globalconfig" target="build\Neolution.Tests.globalconfig" />
21+
<file src="build\Neolution.CodeAnalysis.globalconfig" target="build\Neolution.CodeAnalysis.globalconfig" />
22+
<file src="build\Neolution.CodeAnalysis.TestsRuleset.globalconfig" target="build\Neolution.CodeAnalysis.TestsRuleset.globalconfig" />
2223
<file src="build\stylecop.json" target="build\stylecop.json" />
2324
<file src="README.md" target="docs\" />
2425
</files>

Neolution.CodeAnalysis.nuspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
</metadata>
1919
<files>
2020
<file src="build\Neolution.CodeAnalysis.props" target="build\Neolution.CodeAnalysis.props" />
21-
<file src="build\Neolution.globalconfig" target="build\Neolution.globalconfig" />
21+
<file src="build\Neolution.CodeAnalysis.globalconfig" target="build\Neolution.CodeAnalysis.globalconfig" />
2222
<file src="build\stylecop.json" target="build\stylecop.json" />
2323
<file src="README.md" target="docs\" />
2424
</files>
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Top level entry required to mark this as a global AnalyzerConfig file
2+
# NOTE: Do not create section headers for configuration entries
3+
is_global = true
4+
5+
# For conflicting rules, the higher level has higher priority
6+
global_level = 101
7+
8+
#############################################
9+
########## Rules specific to tests ##########
10+
#############################################
11+
12+
# CA1707: Identifiers should not contain underscores
13+
; We use underscores in test method names to make them easier to read.
14+
dotnet_diagnostic.CA1707.severity = none
15+
16+
# CA1031: Do not catch general exception types
17+
; Since we can raise any Exception we like In Tests we should also be able to catch any Exception we like.
18+
dotnet_diagnostic.CA1031.severity = none
19+
20+
# CA2000: Dispose objects before losing scope
21+
; Tests are never run continuously in a production environment. Resources are freed as soon as the Test run ends, so there is no need to worry about the pitfalls of not freeing resources.
22+
dotnet_diagnostic.CA2000.severity = none
23+
24+
# CA2007: Consider calling ConfigureAwait on the awaited task
25+
; This warning is intended for libraries, where the code may be executed in arbitrary environments and where code shouldn't make assumptions about the environment or how the caller of the method may be invoking or waiting on it
26+
dotnet_diagnostic.CA2007.severity = none
27+
28+
# S112: General exceptions should never be thrown
29+
; In Tests we should be able to raise any Exception we like.
30+
dotnet_diagnostic.S112.severity = none
31+
32+
# S131: "switch/Select" statements should contain a "default/Case Else" clauses
33+
; There is no need for defensive programming in Tests
34+
dotnet_diagnostic.S131.severity = none
35+
36+
# S126: "if ... else if" constructs should end with "else" clauses
37+
; There is no need for defensive programming in Tests
38+
dotnet_diagnostic.S126.severity = none
39+
40+
# S4581: "new Guid()" should not be used
41+
; When creating mocks/substitutes this can be irrelevant, so it should not break the build
42+
dotnet_diagnostic.S4581.severity = suggestion

build/Neolution.CodeAnalysis.TestsRuleset.props

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
</PropertyGroup>
1111

1212
<ItemGroup>
13-
<GlobalAnalyzerConfigFiles Include="$(MSBuildThisFileDirectory)Neolution.Tests.globalconfig" />
13+
<GlobalAnalyzerConfigFiles Include="$(MSBuildThisFileDirectory)Neolution.CodeAnalysis.globalconfig" Link=".globalconfig" />
14+
<GlobalAnalyzerConfigFiles Include="$(MSBuildThisFileDirectory)Neolution.CodeAnalysis.TestsRuleset.globalconfig" Link=".tests.globalconfig" />
1415
<AdditionalFiles Include="$(MSBuildThisFileDirectory)stylecop.json" Link="stylecop.json" />
1516
</ItemGroup>
1617

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
# NOTE: Do not create section headers for configuration entries
33
is_global = true
44

5+
# For conflicting rules, the higher level has higher priority
6+
global_level = 100
7+
58
# Literals should not be passed as localized parameters
69
; Localization is not needed in every project and for every message. This rule disallows string literals everywhere e.g. for log messages, content that does not need to be translated etc.
710
dotnet_diagnostic.S4055.severity = none
@@ -226,6 +229,11 @@ dotnet_diagnostic.CA2007.severity = warning
226229
; Exceptions can be configured in stylecop.json
227230
dotnet_diagnostic.SA1412.severity = warning
228231

232+
# S113: Files should contain an empty newline at the end
233+
; Some tools (e.g. Git Diff) work better when files end with an empty line.
234+
dotnet_diagnostic.S113.severity = warning
235+
dotnet_diagnostic.SA1518.severity = none
236+
229237
# S107: Methods should not have too many parameters
230238
dotnet_diagnostic.S107.severity = warning
231239

@@ -274,9 +282,6 @@ dotnet_diagnostic.S110.severity = warning
274282
# S1109: A close curly brace should be located at the beginning of a line
275283
dotnet_diagnostic.S1109.severity = warning
276284

277-
# S113: Files should contain an empty newline at the end
278-
dotnet_diagnostic.S113.severity = warning
279-
280285
# S1144: Unused private types or members should be removed
281286
dotnet_diagnostic.S1144.severity = warning
282287

build/Neolution.CodeAnalysis.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</PropertyGroup>
1111

1212
<ItemGroup>
13-
<GlobalAnalyzerConfigFiles Include="$(MSBuildThisFileDirectory)Neolution.globalconfig" />
13+
<GlobalAnalyzerConfigFiles Include="$(MSBuildThisFileDirectory)Neolution.CodeAnalysis.globalconfig" Link=".globalconfig" />
1414
<AdditionalFiles Include="$(MSBuildThisFileDirectory)stylecop.json" Link="stylecop.json" />
1515
</ItemGroup>
1616

0 commit comments

Comments
 (0)