Skip to content

Commit

Permalink
Merge pull request #159 from atc-net/feature/Add-support-for-project-…
Browse files Browse the repository at this point in the history
…framework-cli

Feature/add support for project framework cli
  • Loading branch information
davidkallesen authored Apr 11, 2024
2 parents a450a90 + 2e67e47 commit 4ec338b
Show file tree
Hide file tree
Showing 15 changed files with 41 additions and 47 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/atc-coding-rules-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
atc_check_for_updates:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: ⚙ set environment stuff
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/post-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: 🛒 Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.PAT_WORKFLOWS }}
Expand All @@ -31,7 +31,7 @@ jobs:
setAllVars: true

- name: ⚙️ Setup dotnet 8.0.x
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/pre-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- name: 🛒 Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: ⚙️ Setup dotnet 8.0.x
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'

Expand All @@ -39,12 +39,12 @@ jobs:
- dotnet-build
steps:
- name: 🛒 Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: ⚙️ Setup dotnet 8.0.x
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: 🛒 Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.PAT_WORKFLOWS }}
Expand All @@ -28,7 +28,7 @@ jobs:
setAllVars: true

- name: ⚙️ Setup dotnet 8.0.x
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'

Expand Down
4 changes: 2 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@
<ItemGroup Label="Code Analyzers">
<PackageReference Include="AsyncFixer" Version="1.6.0" PrivateAssets="All" />
<PackageReference Include="Asyncify" Version="0.9.7" PrivateAssets="All" />
<PackageReference Include="Meziantou.Analyzer" Version="2.0.146" PrivateAssets="All" />
<PackageReference Include="Meziantou.Analyzer" Version="2.0.147" PrivateAssets="All" />
<PackageReference Include="SecurityCodeScan.VS2019" Version="5.6.7" PrivateAssets="All" />
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.435" PrivateAssets="All" />
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.23.0.88079" PrivateAssets="All" />
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.23.1.88495" PrivateAssets="All" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion sample/atc-coding-rules-updater.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ atc-coding-rules-updater `
run `
-p $currentPath `
--optionsPath $currentPath'\atc-coding-rules-updater.json' `
-v
--verbose
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Atc" Version="2.0.442" />
<PackageReference Include="Atc" Version="2.0.465" />
<PackageReference Include="HtmlAgilityPack" Version="1.11.60" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Atc" Version="2.0.442" />
<PackageReference Include="Atc.DotNet" Version="2.0.442" />
<PackageReference Include="Atc.Console.Spectre" Version="2.0.442" />
<PackageReference Include="EPPlus" Version="7.1.0" />
<PackageReference Include="Atc" Version="2.0.465" />
<PackageReference Include="Atc.DotNet" Version="2.0.465" />
<PackageReference Include="Atc.Console.Spectre" Version="2.0.465" />
<PackageReference Include="EPPlus" Version="7.1.1" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
</ItemGroup>

Expand Down
39 changes: 16 additions & 23 deletions src/Atc.CodingRules.Updater.CLI/ProjectHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,12 @@ private static void HandleEditorConfigFiles(
continue;
}

EditorConfigHelper.HandleFile(logger, "ProjectFramework", projectFrameworkCodingRulesBaseUrl, csProjFile.Directory!, projectFrameworkType.ToStringLowerCase());
EditorConfigHelper.HandleFile(
logger,
"ProjectFramework",
projectFrameworkCodingRulesBaseUrl,
csProjFile.Directory!,
projectFrameworkType.ToStringLowerCase());
}
}

Expand All @@ -141,29 +146,17 @@ private static ProjectFrameworkType DetermineProjectFrameworkType(
}
else
{
switch (projectType)
projectFrameworkType = projectType switch
{
case DotnetProjectType.AzureFunctionApp:
projectFrameworkType = ProjectFrameworkType.AzureFunctions;
break;
case DotnetProjectType.BlazorServerApp:
case DotnetProjectType.BlazorWAsmApp:
projectFrameworkType = ProjectFrameworkType.Blazor;
break;
case DotnetProjectType.MauiApp:
projectFrameworkType = ProjectFrameworkType.Maui;
break;
case DotnetProjectType.WinFormApp:
projectFrameworkType = ProjectFrameworkType.WinForms;
break;
case DotnetProjectType.WpfApp:
case DotnetProjectType.WpfLibrary:
projectFrameworkType = ProjectFrameworkType.Wpf;
break;
case DotnetProjectType.WebApi:
projectFrameworkType = ProjectFrameworkType.WebApi;
break;
}
DotnetProjectType.AzureFunctionApp => ProjectFrameworkType.AzureFunctions,
DotnetProjectType.BlazorServerApp or DotnetProjectType.BlazorWAsmApp => ProjectFrameworkType.Blazor,
DotnetProjectType.CliApp => ProjectFrameworkType.Cli,
DotnetProjectType.MauiApp => ProjectFrameworkType.Maui,
DotnetProjectType.WinFormApp => ProjectFrameworkType.WinForms,
DotnetProjectType.WpfApp or DotnetProjectType.WpfLibrary => ProjectFrameworkType.Wpf,
DotnetProjectType.WebApi => ProjectFrameworkType.WebApi,
_ => projectFrameworkType,
};
}

return projectFrameworkType;
Expand Down
6 changes: 3 additions & 3 deletions src/Atc.CodingRules.Updater/Atc.CodingRules.Updater.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Atc" Version="2.0.442" />
<PackageReference Include="Atc.DotNet" Version="2.0.442" />
<PackageReference Include="Atc.Console.Spectre" Version="2.0.442" />
<PackageReference Include="Atc" Version="2.0.465" />
<PackageReference Include="Atc.DotNet" Version="2.0.465" />
<PackageReference Include="Atc.Console.Spectre" Version="2.0.465" />
</ItemGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions src/Atc.CodingRules.Updater/ProjectFrameworkType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ public enum ProjectFrameworkType
None,
AzureFunctions,
Blazor,
Cli,
Maui,
WebApi,
WinForms,
Expand Down
2 changes: 1 addition & 1 deletion src/Atc.CodingRules/Atc.CodingRules.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Atc" Version="2.0.442" />
<PackageReference Include="Atc" Version="2.0.465" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Atc.XUnit" Version="2.0.442" />
<PackageReference Include="Atc.XUnit" Version="2.0.465" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="xunit" Version="2.7.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.7">
Expand Down
2 changes: 1 addition & 1 deletion test/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Atc.Test" Version="1.0.79" />
<PackageReference Include="Atc.Test" Version="1.0.89" />
<PackageReference Include="NSubstitute.Analyzers.CSharp" Version="1.0.17" PrivateAssets="All" />
</ItemGroup>

Expand Down

0 comments on commit 4ec338b

Please sign in to comment.