Skip to content

Commit d50d7a7

Browse files
committed
Force editorconfig + small changes
1 parent 120d753 commit d50d7a7

File tree

9 files changed

+33
-34
lines changed

9 files changed

+33
-34
lines changed

Build.ps1

+6-5
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Write-Output "build: Build started"
77

88
Push-Location $PSScriptRoot
99
try {
10-
if(Test-Path .\artifacts) {
10+
if (Test-Path .\artifacts) {
1111
Write-Output "build: Cleaning ./artifacts"
1212
Remove-Item ./artifacts -Force -Recurse
1313
}
@@ -28,8 +28,9 @@ try {
2828
Write-Output "build: Package version suffix is $suffix"
2929
Write-Output "build: Build version suffix is $buildSuffix"
3030

31+
& dotnet format --no-restore --verify-no-changes --severity error
3132
& dotnet build -c Release --version-suffix=$buildSuffix /p:ContinuousIntegrationBuild=true
32-
if($LASTEXITCODE -ne 0) { throw "Build failed" }
33+
if ($LASTEXITCODE -ne 0) { throw "Build failed" }
3334

3435
foreach ($src in Get-ChildItem src/*) {
3536
Push-Location $src
@@ -41,7 +42,7 @@ try {
4142
} else {
4243
& dotnet pack -c Release --no-build --no-restore -o ../../artifacts
4344
}
44-
if($LASTEXITCODE -ne 0) { throw "Packaging failed" }
45+
if ($LASTEXITCODE -ne 0) { throw "Packaging failed" }
4546

4647
Pop-Location
4748
}
@@ -52,7 +53,7 @@ try {
5253
Write-Output "build: Testing project in $test"
5354

5455
& dotnet test -c Release --no-build --no-restore
55-
if($LASTEXITCODE -ne 0) { throw "Testing failed" }
56+
if ($LASTEXITCODE -ne 0) { throw "Testing failed" }
5657

5758
Pop-Location
5859
}
@@ -65,7 +66,7 @@ try {
6566

6667
foreach ($nupkg in Get-ChildItem artifacts/*.nupkg) {
6768
& dotnet nuget push -k $env:NUGET_API_KEY -s https://api.nuget.org/v3/index.json "$nupkg"
68-
if($LASTEXITCODE -ne 0) { throw "Publishing failed" }
69+
if ($LASTEXITCODE -ne 0) { throw "Publishing failed" }
6970
}
7071

7172
if (!($suffix)) {

src/Serilog.Settings.Configuration/ConfigurationLoggerConfigurationExtensions.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,8 @@ public static LoggerConfiguration Configuration(
218218
{
219219
var configurationReader = readerOptions switch
220220
{
221-
{ ConfigurationAssemblySource: {} } => GetConfigurationReader(configuration, readerOptions, readerOptions.ConfigurationAssemblySource.Value),
222-
{ Assemblies: {} } => GetConfigurationReader(configuration, readerOptions, readerOptions.Assemblies),
221+
{ ConfigurationAssemblySource: { } } => GetConfigurationReader(configuration, readerOptions, readerOptions.ConfigurationAssemblySource.Value),
222+
{ Assemblies: { } } => GetConfigurationReader(configuration, readerOptions, readerOptions.Assemblies),
223223
_ => GetConfigurationReader(configuration, readerOptions ?? new ConfigurationReaderOptions(), readerOptions?.DependencyContext),
224224
};
225225
return settingConfiguration.Settings(configurationReader);

src/Serilog.Settings.Configuration/Properties/AssemblyInfo.cs

-8
This file was deleted.

src/Serilog.Settings.Configuration/Serilog.Settings.Configuration.csproj

+3-7
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<Description>Microsoft.Extensions.Configuration (appsettings.json) support for Serilog.</Description>
55
<Authors>Serilog Contributors</Authors>
66
<!-- These must match the Dependencies tab in https://www.nuget.org/packages/microsoft.extensions.configuration at
77
the target version. -->
88
<TargetFrameworks>net462;netstandard2.0;net8.0;net9.0</TargetFrameworks>
9-
<GenerateDocumentationFile>true</GenerateDocumentationFile>
109
<PackageTags>serilog;json;appsettings</PackageTags>
1110
<PackageIcon>icon.png</PackageIcon>
1211
<PackageReadmeFile>README.md</PackageReadmeFile>
@@ -16,15 +15,12 @@
1615
<RootNamespace>Serilog</RootNamespace>
1716
</PropertyGroup>
1817

19-
<ItemGroup>
20-
<Using Remove="System.Net.Http" />
21-
</ItemGroup>
22-
2318
<ItemGroup>
2419
<PackageReference Include="PolySharp" Version="1.13.2" PrivateAssets="All" />
2520
<PackageReference Include="Serilog" Version="4.2.0-*" />
2621
<None Include="..\..\assets\icon.png" Pack="true" PackagePath="" Visible="false" />
27-
<None Include="..\..\README.md" Pack="true" PackagePath="" />
22+
<None Include="..\..\README.md" Pack="true" PackagePath="" Visible="false" />
23+
<InternalsVisibleTo Include="Serilog.Settings.Configuration.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100fb8d13fd344a1c6fe0fe83ef33c1080bf30690765bc6eb0df26ebfdf8f21670c64265b30db09f73a0dea5b3db4c9d18dbf6d5a25af5ce9016f281014d79dc3b4201ac646c451830fc7e61a2dfd633d34c39f87b81894191652df5ac63cc40c77f3542f702bda692e6e8a9158353df189007a49da0f3cfd55eb250066b19485ec" />
2824
</ItemGroup>
2925

3026
<ItemGroup>

src/Serilog.Settings.Configuration/Settings/Configuration/ObjectArgumentValue.cs

+19-5
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public ObjectArgumentValue(IConfigurationSection section, IReadOnlyCollection<As
2929
// process a nested configuration to populate an Action<> logger/sink config parameter?
3030
var typeInfo = toType.GetTypeInfo();
3131
if (typeInfo.IsGenericType &&
32-
typeInfo.GetGenericTypeDefinition() is {} genericType && genericType == typeof(Action<>))
32+
typeInfo.GetGenericTypeDefinition() is { } genericType && genericType == typeof(Action<>))
3333
{
3434
var configType = typeInfo.GenericTypeArguments[0];
3535
IConfigurationReader configReader = new ConfigurationReader(_section, _configurationAssemblies, resolutionContext);
@@ -185,14 +185,28 @@ bool TryCallCtor(Type type, Dictionary<string, IConfigurationSection> suppliedAr
185185
}
186186
else
187187
{
188-
return new { ci, args, isCallable = false, matches, stringMatches,
189-
usedArguments = suppliedNames };
188+
return new
189+
{
190+
ci,
191+
args,
192+
isCallable = false,
193+
matches,
194+
stringMatches,
195+
usedArguments = suppliedNames
196+
};
190197
}
191198
}
192199
}
193200

194-
return new { ci, args, isCallable = true, matches, stringMatches,
195-
usedArguments = suppliedNames };
201+
return new
202+
{
203+
ci,
204+
args,
205+
isCallable = true,
206+
matches,
207+
stringMatches,
208+
usedArguments = suppliedNames
209+
};
196210
})
197211
.Where(binding => binding.isCallable)
198212
.OrderByDescending(binding => binding.matches)

test/Serilog.Settings.Configuration.Tests/ApiApprovalTests.cs renamed to test/Serilog.Settings.Configuration.Tests/Approval/ApiApprovalTests.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if NET7_0
1+
#if NET9_0
22

33
using PublicApiGenerator;
44
using Shouldly;
@@ -15,7 +15,7 @@ public void PublicApi_Should_Not_Change_Unintentionally()
1515
new()
1616
{
1717
IncludeAssemblyAttributes = false,
18-
ExcludeAttributes = new[] { "System.Diagnostics.DebuggerDisplayAttribute" },
18+
ExcludeAttributes = [ "System.Diagnostics.DebuggerDisplayAttribute" ],
1919
});
2020

2121
publicApi.ShouldMatchApproved(options => options.WithFilenameGenerator((_, _, fileType, fileExtension) => $"{assembly.GetName().Name!}.{fileType}.{fileExtension}"));

test/Serilog.Settings.Configuration.Tests/Support/ConfigurationReaderTestHelpers.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public static IConfigurationRoot GetConfigRoot(
5353
{
5454
var configBuilder = new ConfigurationBuilder();
5555

56-
configBuilder.AddJsonString(appsettingsJsonLevel ?? "{}");
56+
configBuilder.AddJsonString(appsettingsJsonLevel ?? "{}");
5757
configBuilder.AddJsonString(appsettingsDevelopmentJsonLevel ?? "{}");
5858
configBuilder.Add(new ReloadableConfigurationSource(envVariables ?? new Dictionary<string, string?>()));
5959

test/TestDummies/TestDummies.csproj

-4
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,4 @@
1414
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="9.0.0" />
1515
</ItemGroup>
1616

17-
<ItemGroup>
18-
<Using Remove="System.Net.Http" />
19-
</ItemGroup>
20-
2117
</Project>

0 commit comments

Comments
 (0)