Skip to content

Commit ae537f4

Browse files
authored
Merge pull request #6 from xt0rted/tests
Add some tests and refactor how scripts are passed around
2 parents 1f38037 + 9fa3058 commit ae537f4

28 files changed

+344
-53
lines changed

.editorconfig

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ dotnet_style_qualification_for_property = false:error
4848
dotnet_style_qualification_for_method = false:error
4949
dotnet_style_qualification_for_event = false:error
5050

51-
# CA1062: Validate arguments of public methods
52-
dotnet_diagnostic.CA1062.severity = error
5351

5452
## Naming Conventions
5553
[*.{cs,vb}]

.github/workflows/ci.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,18 @@ jobs:
4848
uses: actions/[email protected]
4949
with:
5050
source-url: https://nuget.pkg.github.com/xt0rted/index.json
51-
dotnet-version: 6.0.x
51+
dotnet-version: |
52+
3.1.x
53+
5.0.x
54+
6.0.x
5255
env:
5356
NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5457

5558
- run: dotnet tool restore
5659

5760
- run: dotnet r build
5861

59-
- run: dotnet r test --if-present
62+
- run: dotnet r test
6063

6164
- run: dotnet r pack -- --version-suffix ${{ env.VERSION_SUFFIX }}
6265

.github/workflows/codeql-analysis.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ on:
77
branches: [main]
88
schedule:
99
- cron: "25 0 * * 5"
10+
workflow_dispatch:
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
env:
17+
DOTNET_NOLOGO: true
1018

1119
jobs:
1220
analyze:
@@ -28,6 +36,18 @@ jobs:
2836
- name: Check out repository
2937
uses: actions/[email protected]
3038

39+
# This action doesn't support comments in the global.json so for now we have to specify all sdk versions
40+
- name: Set up .NET
41+
uses: actions/[email protected]
42+
with:
43+
source-url: https://nuget.pkg.github.com/xt0rted/index.json
44+
dotnet-version: |
45+
3.1.x
46+
5.0.x
47+
6.0.x
48+
env:
49+
NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50+
3151
- name: Initialize CodeQL
3252
uses: github/codeql-action/init@v1
3353
with:

.github/workflows/release.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ jobs:
3030
uses: actions/[email protected]
3131
with:
3232
source-url: https://nuget.pkg.github.com/xt0rted/index.json
33-
dotnet-version: 6.0.x
33+
dotnet-version: |
34+
3.1.x
35+
5.0.x
36+
6.0.x
3437
env:
3538
NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3639

@@ -44,7 +47,7 @@ jobs:
4447

4548
- run: dotnet r build
4649

47-
- run: dotnet r test --if-present
50+
- run: dotnet r test
4851

4952
- run: dotnet r pack
5053

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ node_modules/
301301
*.dsw
302302
*.dsp
303303

304-
# Visual Studio 6 technical files
304+
# Visual Studio 6 technical files
305305
*.ncb
306306
*.aps
307307

@@ -396,3 +396,6 @@ FodyWeavers.xsd
396396

397397
# JetBrains Rider
398398
*.sln.iml
399+
400+
# Verify snapshots
401+
*.received.*

Directory.Build.props

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
<IsPackable>false</IsPackable>
99
</PropertyGroup>
1010

11+
<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.1' ">
12+
<EnableNETAnalyzers>true</EnableNETAnalyzers>
13+
<AnalysisLevel>latest</AnalysisLevel>
14+
</PropertyGroup>
15+
1116
<PropertyGroup>
1217
<VersionPrefix>0.1.0</VersionPrefix>
1318
<Authors>Brian Surowiec</Authors>

analysis/idisposable.editorconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
is_global = true
22

3+
#
34
# Rules
45

56
# IDISP001: Dispose created

analysis/sdk.editorconfig

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
is_global = true
2+
3+
#
4+
# Rules
5+
6+
# CA1062: Validate arguments of public methods
7+
dotnet_diagnostic.CA1062.severity = error
8+
9+
# CA1303: Do not pass literals as localized parameters
10+
dotnet_diagnostic.CA1303.severity = error
11+
12+
# CA1304: Specify CultureInfo
13+
dotnet_diagnostic.CA1304.severity = error
14+
15+
# CA1305: Specify IFormatProvider
16+
dotnet_diagnostic.CA1305.severity = error
17+
18+
# CA1307: Specify StringComparison for clarity
19+
dotnet_diagnostic.CA1307.severity = error
20+
21+
# CA1308: Normalize strings to uppercase
22+
dotnet_diagnostic.CA1308.severity = error
23+
24+
# CA1309: Use ordinal StringComparison
25+
dotnet_diagnostic.CA1309.severity = error
26+
27+
# CA1310: Specify StringComparison for correctness
28+
dotnet_diagnostic.CA1310.severity = error
29+
30+
# CA1838: Avoid StringBuilder parameters for P/Invokes
31+
dotnet_diagnostic.CA1838.severity = error
32+
33+
# CA2101: Specify marshalling for P/Invoke string arguments
34+
dotnet_diagnostic.CA2101.severity = error

global.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
"prebuild": "dotnet r clean",
1010
"build": "dotnet build",
1111
"test": "dotnet test --no-build --logger \"trx\" --results-directory \"./.coverage\"",
12+
"test:31": "dotnet r test -- --framework netcoreapp3.1",
13+
"test:5": "dotnet r test -- --framework net5.0",
14+
"test:6": "dotnet r test -- --framework net6.0",
1215
"pack": "dotnet pack --no-build --output ./artifacts",
1316

1417
"build:release": "dotnet r build -- --configuration Release",

run-script.sln

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
1919
README.md = README.md
2020
EndProjectSection
2121
EndProject
22+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tests", "test\Tests.csproj", "{0A834097-CB5A-4E14-845D-1AA0E8EBEA29}"
23+
EndProject
2224
Global
2325
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2426
Debug|Any CPU = Debug|Any CPU
@@ -29,6 +31,10 @@ Global
2931
{AEF0FF86-3911-45DE-9291-EDC8E96329F4}.Debug|Any CPU.Build.0 = Debug|Any CPU
3032
{AEF0FF86-3911-45DE-9291-EDC8E96329F4}.Release|Any CPU.ActiveCfg = Release|Any CPU
3133
{AEF0FF86-3911-45DE-9291-EDC8E96329F4}.Release|Any CPU.Build.0 = Release|Any CPU
34+
{0A834097-CB5A-4E14-845D-1AA0E8EBEA29}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
35+
{0A834097-CB5A-4E14-845D-1AA0E8EBEA29}.Debug|Any CPU.Build.0 = Debug|Any CPU
36+
{0A834097-CB5A-4E14-845D-1AA0E8EBEA29}.Release|Any CPU.ActiveCfg = Release|Any CPU
37+
{0A834097-CB5A-4E14-845D-1AA0E8EBEA29}.Release|Any CPU.Build.0 = Release|Any CPU
3238
EndGlobalSection
3339
GlobalSection(SolutionProperties) = preSolution
3440
HideSolutionNode = FALSE

0 commit comments

Comments
 (0)