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

Update TargetFramework to net9 #13

Merged
merged 1 commit into from
Dec 1, 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
39 changes: 0 additions & 39 deletions .circleci/config.yml

This file was deleted.

37 changes: 37 additions & 0 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: .NET 9 CI

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
dotnet: [ '9.0.x' ]
steps:
- name: Check out
uses: actions/checkout@v4
- name: Setup .NET SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.dotnet }}
- name: Build
run: dotnet build --configuration Release
- name: Install
run: dotnet tool install -g dotnet-reportgenerator-globaltool
- name: Test
run: |
rm -rf MsTestResults
dotnet test --configuration Release --no-build --logger "console;verbosity=detailed" --collect:"XPlat Code Coverage" --results-directory MsTestResults
reportgenerator -reports:MsTestResults/*/coverage.cobertura.xml -targetdir:Coverlet-html
- name: Archive artifacts (code coverage)
uses: actions/upload-artifact@v4
with:
name: code-coverage-report-${{ matrix.dotnet }}
path: Coverlet-html
25 changes: 25 additions & 0 deletions BomSweeper.GlobalTool/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[*.cs]

# SA1101: Prefix local calls with this
dotnet_diagnostic.SA1101.severity = none

# SA1122: Use string.Empty for empty strings
dotnet_diagnostic.SA1122.severity = none

# SA1302: Interface names should begin with I
dotnet_diagnostic.SA1302.severity = none

# SA1513: Closing brace should be followed by blank line
dotnet_diagnostic.SA1513.severity = none

# SA1633: File should have header
dotnet_diagnostic.SA1633.severity = none

# IsNull: Do not use 'is' pattern matching with 'null'.
dotnet_diagnostic.IsNull.severity = none

# SA1012: Opening braces should be spaced correctly
dotnet_diagnostic.SA1012.severity = none

# SA1013: Closing braces should be spaced correctly
dotnet_diagnostic.SA1013.severity = none
11 changes: 8 additions & 3 deletions BomSweeper.GlobalTool/BomSweeper.GlobalTool.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net9</TargetFramework>
<LangVersion>13.0</LangVersion>
<PackAsTool>true</PackAsTool>
<ToolCommandName>bomsweeper</ToolCommandName>
</PropertyGroup>
Expand All @@ -14,14 +15,15 @@
<PackageProjectUrl>https://maroontress.github.io/BomSweeper-CSharp/</PackageProjectUrl>
<RepositoryUrl>https://github.com/maroontress/BomSweeper.CSharp</RepositoryUrl>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<Description>BomSweeper is a command line tool that finds the files starting with a UTF-8 Byte Order Mark (BOM) in the directory tree and removes a BOM from those files.</Description>
<Description>BomSweeper is a command line tool that finds the files starting with a UTF-8 Byte Order Mark (BOM) in the directory tree and removes BOMs from those files.</Description>
<PackageReleaseNotes>See https://maroontress.github.io/BomSweeper-CSharp/releasenotes.html</PackageReleaseNotes>
<Copyright>Copyright (c) 2019 Maroontress Fast Software</Copyright>
<PackageTags>csharp, dotnet-core, global-tool, bomsweeper</PackageTags>
<NoPackageAnalysis>true</NoPackageAnalysis>
<Version>1.0.1.0</Version>
<Version>2.0.0</Version>
<RepositoryType />
<Company>Maroontress Fast Software</Company>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageLicenseFile>COPYRIGHT.txt</PackageLicenseFile>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
</PropertyGroup>
Expand All @@ -45,4 +47,7 @@
<ProjectReference Include="..\BomSweeper\BomSweeper.csproj" />
</ItemGroup>

<ItemGroup>
<None Include="..\README.md" Pack="true" PackagePath="\" />
</ItemGroup>
</Project>
11 changes: 5 additions & 6 deletions BomSweeper.GlobalTool/Program.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
namespace BomSweeper.GlobalTool
namespace BomSweeper.GlobalTool;

public sealed class Program
{
class Program
static void Main(string[] args)
{
static void Main(string[] args)
{
BomSweeper.Program.Main(args);
}
BomSweeper.Program.Main(args);
}
}
23 changes: 13 additions & 10 deletions BomSweeper.Test/BomSweeper.Test.csproj
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net9</TargetFramework>
<IsPackable>false</IsPackable>
<LangVersion>8.0</LangVersion>
<LangVersion>13.0</LangVersion>
<Nullable>enable</Nullable>
</PropertyGroup>

Expand All @@ -26,14 +26,17 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="coverlet.msbuild" Version="2.9.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
<PackageReference Include="MSTest.TestAdapter" Version="2.1.1" />
<PackageReference Include="MSTest.TestFramework" Version="2.1.1" />
<PackageReference Include="ReportGenerator" Version="4.6.0" />
<PackageReference Include="StyleChecker" Version="1.0.25" PrivateAssets="all" />
<PackageReference Include="coverlet.collector" Version="6.0.2" PrivateAssets="all">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.6.3" />
<PackageReference Include="MSTest.TestFramework" Version="3.6.3" />
<PackageReference Include="ReportGenerator" Version="5.4.1" />
<PackageReference Include="StyleChecker" Version="2.0.1" PrivateAssets="all" />
<PackageReference Include="StyleChecker.Annotations" Version="1.0.1" />
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.164" PrivateAssets="all" />
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.556" PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
Expand Down
53 changes: 26 additions & 27 deletions BomSweeper.Test/ElementsTest.cs
Original file line number Diff line number Diff line change
@@ -1,33 +1,32 @@
namespace BomSweeper.Test
{
using System;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace BomSweeper.Test;

using System;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;

[TestClass]
public sealed class ElementsTest
[TestClass]
public sealed class ElementsTest
{
[TestMethod]
public void SeparateWithEmpty()
{
[TestMethod]
public void SeparateWithEmpty()
{
var actual = Elements.Separate(Array.Empty<string>(), "foo");
Assert.IsFalse(actual.Any());
}
var actual = Elements.Separate([], "foo");
Assert.IsFalse(actual.Any());
}

[TestMethod]
public void SeparateWithSingle()
{
var actual = Elements.Separate(new[] { "bar" }, "foo");
Assert.AreEqual(actual.Count(), 1);
Assert.AreEqual(actual.First(), "bar");
}
[TestMethod]
public void SeparateWithSingle()
{
var actual = Elements.Separate(["bar"], "foo");
Assert.AreEqual(actual.Count(), 1);
Assert.AreEqual(actual.First(), "bar");
}

[TestMethod]
public void SeparateWithDouble()
{
var actual = Elements.Separate(new[] { "bar", "baz" }, "foo");
var expected = new[] { "bar", "foo", "baz" };
Assert.IsTrue(Enumerable.SequenceEqual(actual, expected));
}
[TestMethod]
public void SeparateWithDouble()
{
var actual = Elements.Separate(["bar", "baz"], "foo");
var expected = new[] { "bar", "foo", "baz" };
Assert.IsTrue(Enumerable.SequenceEqual(actual, expected));
}
}
Loading