Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove NoWarn for IDE0055 #95

Merged
merged 8 commits into from
Mar 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Build and test

on:
push:
branches: [ "master" ]
pull_request:
branches: [ '*' ]


env:
working-directory: Sources
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: true
dotnet-version: 8.0.x

jobs:
build:
runs-on: ubuntu-latest

steps:
- run: git config --global core.autocrlf input
- uses: actions/checkout@v3
with:
submodules: true

- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.dotnet-version }}

- name: Restore dependencies
run: dotnet restore
working-directory: ${{ env.working-directory }}

- name: Build
run: dotnet build -c Release --no-restore --verbosity normal
working-directory: ${{ env.working-directory }}

- name: Test
run: dotnet test -c Release --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
working-directory: ${{ env.working-directory }}

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
37 changes: 0 additions & 37 deletions .github/workflows/dotnet.yml

This file was deleted.

199 changes: 103 additions & 96 deletions Sources/.editorconfig

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions Sources/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<Project>
<PropertyGroup>
<LangVersion>latest</LangVersion>
<NoWarn>$(NoWarn);CS1591;IDE0055</NoWarn>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
</PropertyGroup>
<PropertyGroup>
<LangVersion>latest</LangVersion>
<NoWarn>$(NoWarn);CS1591</NoWarn>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
</PropertyGroup>
</Project>
45 changes: 23 additions & 22 deletions Sources/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,31 @@
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="codeessentials.Extensions.Logging.Demystifier" Version="1.1.66" />
<PackageVersion Include="Kysect.CommonLib" Version="0.1.8" />
<PackageVersion Include="Kysect.CommonLib.DependencyInjection" Version="0.1.8" />
<PackageVersion Include="Kysect.Editorconfig" Version="1.1.4" />
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="7.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="7.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="7.0.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="7.0.1" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.1" />
<PackageVersion Include="Microsoft.Extensions.Options" Version="7.0.1" />
<PackageVersion Include="Microsoft.Extensions.Options.DataAnnotations" Version="7.0.0" />
<PackageVersion Include="Serilog" Version="3.0.1" />
<PackageVersion Include="Serilog.Extensions.Logging" Version="7.0.0" />
<PackageVersion Include="Serilog.Settings.Configuration" Version="7.0.1" />
<PackageVersion Include="Serilog.Sinks.Console" Version="4.1.0" />
<PackageVersion Include="Spectre.Console.Cli" Version="0.47.0" />
<PackageVersion Include="Kysect.CommonLib" Version="0.1.19" />
<PackageVersion Include="Kysect.CommonLib.DependencyInjection" Version="0.1.19" />
<PackageVersion Include="Kysect.Editorconfig" Version="1.1.8" />
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Options" Version="8.0.2" />
<PackageVersion Include="Microsoft.Extensions.Options.DataAnnotations" Version="8.0.0" />
<PackageVersion Include="Serilog" Version="3.1.1" />
<PackageVersion Include="Serilog.Extensions.Logging" Version="8.0.0" />
<PackageVersion Include="Serilog.Settings.Configuration" Version="8.0.0" />
<PackageVersion Include="Serilog.Sinks.Console" Version="5.0.1" />
<PackageVersion Include="Spectre.Console.Cli" Version="0.48.0" />
<PackageVersion Include="System.ComponentModel.Annotations" Version="5.0.0" />
<PackageVersion Include="Markdig" Version="0.33.0" />
<PackageVersion Include="Markdig" Version="0.35.0" />
<PackageVersion Include="FluentAssertions" Version="[6.12.0, )" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageVersion Include="NUnit" Version="3.13.3" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageVersion Include="NUnit" Version="4.1.0" />
<PackageVersion Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageVersion Include="NUnit.Analyzers" Version="3.6.1" />
<PackageVersion Include="coverlet.collector" Version="6.0.0" />
<PackageVersion Include="NUnit.Analyzers" Version="4.0.1" />
<PackageVersion Include="coverlet.collector" Version="6.0.1" />
<PackageVersion Include="TestableIO.System.IO.Abstractions.Wrappers" Version="20.0.15" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public string FormatRule(ICodeStyleElement element)
{
CodeStyleRoslynStyleRuleConfiguration styleRule => FormatStyleRule(styleRule),
CodeStyleRoslynQualityRuleConfiguration qualityRule => FormatQualityRule(qualityRule),
_ => throw SwitchDefaultExceptions.OnUnexpectedType(nameof(element), element)
_ => throw SwitchDefaultExceptions.OnUnexpectedType(element)
};
}

Expand Down
2 changes: 0 additions & 2 deletions Sources/Kysect.Configuin.Console/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@ public static void Main(string[] args)

IServiceCollection registrations = DependencyBuilder.InitializeServiceProvider();

#if DEBUG
if (args.Length == 0)
args = PrepareTestCommand(registrations);
#endif

var registrar = new TypeRegistrar(registrations);
var app = new CommandApp(registrar);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using Kysect.CommonLib.BaseTypes.Extensions;
using Kysect.CommonLib.FileSystem.Extensions;
using Kysect.CommonLib.FileSystem;
using Microsoft.Extensions.Logging;

namespace Kysect.Configuin.DotnetFormatIntegration.FileSystem;
Expand All @@ -25,7 +25,7 @@ public IFileMoveUndoOperation MoveFile(string sourcePath, string targetPath)
var targetFileInfo = new FileInfo(targetPath);
DirectoryInfo targetFileDirectory = targetFileInfo.Directory.ThrowIfNull();
string tempFileDirectory = Path.Combine(targetFileDirectory.FullName, ".congifuing");
DirectoryExtensions.EnsureFileExists(tempFileDirectory);
DirectoryExtensions.EnsureDirectoryExists(new System.IO.Abstractions.FileSystem(), tempFileDirectory);

string tempFilePath = Path.Combine(tempFileDirectory, targetFileInfo.Name);
_logger.LogInformation("Target path already exists. Save target file to temp path {tempPath}", tempFilePath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<PackageReference Include="Kysect.CommonLib" />
<PackageReference Include="Kysect.Editorconfig" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" />
<PackageReference Include="TestableIO.System.IO.Abstractions.Wrappers" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion Sources/Kysect.Configuin.RoslynModels/RoslynRuleType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public static string ToAlias(this RoslynRuleType ruleType)
{
RoslynRuleType.StyleRule => "IDE",
RoslynRuleType.QualityRule => "CA",
_ => throw SwitchDefaultExceptions.OnUnexpectedEnum(nameof(ruleType), ruleType)
_ => throw SwitchDefaultExceptions.OnUnexpectedType(ruleType)
};
}
}
5 changes: 4 additions & 1 deletion Sources/Kysect.Configuin.Tests/Kysect.Configuin.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="NUnit" />
<PackageReference Include="NUnit3TestAdapter" />
<PackageReference Include="NUnit.Analyzers" />
<PackageReference Include="NUnit.Analyzers">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.collector">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
4 changes: 2 additions & 2 deletions Sources/Kysect.Configuin.Tests/TemporaryFileMoverTests.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using FluentAssertions;
using Kysect.CommonLib.FileSystem.Extensions;
using Kysect.CommonLib.FileSystem;
using Kysect.Configuin.DotnetFormatIntegration.FileSystem;
using Kysect.Configuin.Tests.Tools;
using NUnit.Framework;
Expand All @@ -20,7 +20,7 @@ public TemporaryFileMoverTests()
[SetUp]
public void Setup()
{
DirectoryExtensions.EnsureFileExists(TestGenerated);
DirectoryExtensions.EnsureDirectoryExists(new System.IO.Abstractions.FileSystem(), TestGenerated);
}

[TearDown]
Expand Down
10 changes: 8 additions & 2 deletions Sources/Kysect.Configuin.sln
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,15 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Kysect.Configuin.MsLearn",
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Kysect.Configuin.EditorConfig", "Kysect.Configuin.EditorConfig\Kysect.Configuin.EditorConfig.csproj", "{AF0452EC-1E00-4490-9B1A-C3FA9810B2C9}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Kysect.Configuin.ConfigurationRoot", "Kysect.Configuin.ConfigurationRoot\Kysect.Configuin.ConfigurationRoot.csproj", "{71590EE8-BD16-4E45-8299-4D1CA3B0EC42}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Kysect.Configuin.ConfigurationRoot", "Kysect.Configuin.ConfigurationRoot\Kysect.Configuin.ConfigurationRoot.csproj", "{71590EE8-BD16-4E45-8299-4D1CA3B0EC42}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Kysect.Configuin.CodeStyleDoc", "Kysect.Configuin.CodeStyleDoc\Kysect.Configuin.CodeStyleDoc.csproj", "{372CD01F-754F-4D95-8F59-F08F9BC645A6}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Kysect.Configuin.CodeStyleDoc", "Kysect.Configuin.CodeStyleDoc\Kysect.Configuin.CodeStyleDoc.csproj", "{372CD01F-754F-4D95-8F59-F08F9BC645A6}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{947325E5-C0FB-4DB1-8BBB-9371FFC6CDEE}"
ProjectSection(SolutionItems) = preProject
Directory.Build.props = Directory.Build.props
Directory.Packages.props = Directory.Packages.props
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
Loading