Skip to content

Commit b809883

Browse files
committed
Update CI workflow, fix more tests
1 parent a4ad21e commit b809883

3 files changed

Lines changed: 9 additions & 5 deletions

File tree

.github/workflows/dotnet.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: Setup .NET
1717
uses: actions/setup-dotnet@v4
1818
with:
19-
dotnet-version: 6.0.x
19+
dotnet-version: 10.0.x
2020
- name: Restore dependencies
2121
run: dotnet restore
2222
- name: Build

Example/Program.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ class SomeClass
1616
// This field will be ignored by SharpConfig
1717
// when creating sections from objects and vice versa.
1818
[SharpConfig.Ignore]
19+
#pragma warning disable CS0649 // Field is never assigned to
1920
public int SomeIgnoredField;
21+
#pragma warning restore CS0649
2022

2123
// Same for this property.
2224
[SharpConfig.Ignore]
@@ -156,10 +158,10 @@ private static void HowToHandleArrays()
156158
// There is also a non-generic variant of GetValueArray:
157159
var sameValuesButObjects = cfg["GeneralSection"]["SomeInts"].GetValueArray(typeof(int));
158160

159-
PrintArray("someIntValuesBack", someIntValuesBack);
160-
PrintArray("sameValuesButFloats", sameValuesButFloats);
161-
PrintArray("sameValuesButStrings", sameValuesButStrings);
162-
PrintArray("sameValuesButObjects", sameValuesButObjects);
161+
PrintArray("someIntValuesBack", someIntValuesBack!);
162+
PrintArray("sameValuesButFloats", sameValuesButFloats!);
163+
PrintArray("sameValuesButStrings", sameValuesButStrings!);
164+
PrintArray("sameValuesButObjects", sameValuesButObjects!);
163165
}
164166

165167
/// <summary>

Tests/SimpleConfigTest.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,9 @@ public void ArrayParsing()
322322
sealed class SectionTestObject
323323
{
324324
public string[]? SomeArrayProp { get; set; }
325+
#pragma warning disable CS0649 // Field is never assigned to (assigned via SharpConfig)
325326
public string[]? SomeArrayField;
327+
#pragma warning restore CS0649
326328
}
327329

328330
[Test]

0 commit comments

Comments
 (0)