Skip to content
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
3 changes: 2 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@
*.cs text=auto diff=csharp

*.csproj text=auto
*.sln text=auto eol=crlf
*.sln text=auto eol=crlf
*.slnx text=auto eol=crlf
3 changes: 2 additions & 1 deletion .github/markdown-link-check-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@
},
"description": "Avoids 403s from GitHub docs"
}
]
],
"aliveStatusCodes": [429, 200]
}
2 changes: 1 addition & 1 deletion .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
runs-on: ${{ matrix.os }}
env:
SLN_DIR: GitHubIssueFormsParser
SLN_FILENAME: GitHubIssueFormsParser.sln
SLN_FILENAME: GitHubIssueFormsParser.slnx
TEST_RESULTS_ARTIFACT_NAME: test-results
CODE_COVERAGE_ARTIFACT_NAME: code-coverage-report
steps:
Expand Down
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# See https://hub.docker.com/_/microsoft-dotnet-runtime/ for list of tags for dotnet runtime
# See https://hub.docker.com/_/microsoft-dotnet-sdk for list of tags for dotnet sdk

FROM mcr.microsoft.com/dotnet/runtime:8.0-alpine AS base
FROM mcr.microsoft.com/dotnet/runtime:9.0-alpine AS base
# install powershell as per https://docs.microsoft.com/en-us/powershell/scripting/install/install-alpine
# the official docs install libssl1.1 but that started to fail and I tried ussing libssl3 which seems to work
ARG PWSH_VERSION=7.4.1
Expand All @@ -28,10 +28,12 @@ RUN chmod +x /opt/microsoft/powershell/7/pwsh
RUN ln -s /opt/microsoft/powershell/7/pwsh /usr/bin/pwsh
# end of install powershell

FROM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS build
FROM mcr.microsoft.com/dotnet/sdk:9.0-alpine AS build
WORKDIR /github-issue-forms-parser
COPY ["GitHubIssueFormsParser/NuGet.Config", "GitHubIssueFormsParser/"]
COPY ["GitHubIssueFormsParser/src/GitHubIssuesParserCli/GitHubIssuesParserCli.csproj", "GitHubIssueFormsParser/src/GitHubIssuesParserCli/"]
COPY ["GitHubIssueFormsParser/Directory.Build.props", "GitHubIssueFormsParser/"]
COPY ["GitHubIssueFormsParser/Directory.Packages.props", "GitHubIssueFormsParser/"]
RUN dotnet restore "GitHubIssueFormsParser/src/GitHubIssuesParserCli/GitHubIssuesParserCli.csproj"
COPY . .
WORKDIR "/github-issue-forms-parser/GitHubIssueFormsParser/src/GitHubIssuesParserCli"
Expand Down
4 changes: 3 additions & 1 deletion GitHubIssueFormsParser/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ trim_trailing_whitespace = true
##########################################

# Visual Studio Solution Files
[*.sln]
[*.{sln,slnx}]
indent_style = tab

# Visual Studio XML Project Files
Expand Down Expand Up @@ -96,6 +96,7 @@ dotnet_diagnostic.CA1303.severity = none # CA1303: Do not pass literals a
dotnet_diagnostic.CA1308.severity = none # CA1308: Normalize strings to uppercase
# Maintainability rules https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/maintainability-warnings
dotnet_diagnostic.CA1508.severity = none # CA1508: Avoid dead conditional code # This one seems to flag false positives in some cases
dotnet_diagnostic.CA1515.severity = none # CA1515: Consider making public types internal # As of writing this there are several open issues about this rule but this one seems to sum the problem https://github.com/dotnet/roslyn-analyzers/issues/7192. Other issues: https://github.com/dotnet/roslyn-analyzers/issues?q=ca1515
# Naming rules https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/naming-warnings
dotnet_diagnostic.CA1711.severity = none # CA1711: Identifiers should not have incorrect suffix
# Reliability rules https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/reliability-warnings
Expand Down Expand Up @@ -399,6 +400,7 @@ dotnet_diagnostic.MA0032.severity = warning # MA0032 Use an overload with a Canc
dotnet_diagnostic.MA0048.severity = none # MA0048 File name must match type name
dotnet_diagnostic.MA0076.severity = none # MA0076 Do not use implicit culture-sensitive ToString in interpolated strings
dotnet_diagnostic.MA0101.severity = none # MA0101 String contains an implicit end of line character
dotnet_diagnostic.MA0165.severity = none # MA0165 Make interpolated string. See https://github.com/meziantou/Meziantou.Analyzer/issues/764

##########################################
# Rules for Microsoft.VisualStudio.Threading.Analyzers
Expand Down
29 changes: 16 additions & 13 deletions GitHubIssueFormsParser/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -41,43 +41,46 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Meziantou.Analyzer" Version="2.0.172">
<PackageReference Include="Meziantou.Analyzer">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.11.20">
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Roslynator.Analyzers" Version="4.12.8">
<PackageReference Include="Roslynator.Analyzers">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Roslynator.CodeAnalysis.Analyzers" Version="4.12.8">
<PackageReference Include="Roslynator.CodeAnalysis.Analyzers">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Roslynator.Formatting.Analyzers" Version="4.12.8">
<PackageReference Include="Roslynator.Formatting.Analyzers">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.556">
<PackageReference Include="StyleCop.Analyzers.Unstable">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup Condition="'$(IsTestProject)' == 'true'">
<PackageReference Include="coverlet.msbuild" Version="6.0.2">
<PackageReference Include="coverlet.msbuild">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="NSubstitute" Version="5.1.0" />
<PackageReference Include="Shouldly" Version="4.2.1" />
<PackageReference Include="xunit.analyzers" Version="1.16.0" />
<PackageReference Include="NSubstitute.Analyzers.CSharp" Version="1.0.17" />
<PackageReference Include="GitHubActionsTestLogger" Version="2.4.1" />
<PackageReference Include="LiquidTestReports.Custom" Version="1.0.9" />
<PackageReference Include="NSubstitute" />
<PackageReference Include="Shouldly" />
<PackageReference Update="xunit.analyzers">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="NSubstitute.Analyzers.CSharp" />
<PackageReference Include="GitHubActionsTestLogger" />
<PackageReference Include="LiquidTestReports.Custom" />
</ItemGroup>

</Project>
28 changes: 28 additions & 0 deletions GitHubIssueFormsParser/Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<Project>
<PropertyGroup>
<!-- Enable central package management, https://learn.microsoft.com/en-us/nuget/consume-packages/Central-Package-Management -->
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="CliFx" Version="2.3.6" />
<PackageVersion Include="SlugGenerator" Version="2.0.2" />
<PackageVersion Include="YamlDotNet" Version="16.3.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.14.0" />
<PackageVersion Include="xunit" Version="2.9.3" />
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.0" />
<PackageVersion Include="coverlet.collector" Version="6.0.4" />
<PackageVersion Include="Meziantou.Analyzer" Version="2.0.201" />
<PackageVersion Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.14.15" />
<PackageVersion Include="Roslynator.Analyzers" Version="4.13.1" />
<PackageVersion Include="Roslynator.CodeAnalysis.Analyzers" Version="4.13.1" />
<PackageVersion Include="Roslynator.Formatting.Analyzers" Version="4.13.1" />
<PackageVersion Include="StyleCop.Analyzers.Unstable" Version="1.2.0.556" />
<PackageVersion Include="coverlet.msbuild" Version="6.0.4" />
<PackageVersion Include="NSubstitute" Version="5.3.0" />
<PackageVersion Include="Shouldly" Version="4.3.0" />
<PackageVersion Include="xunit.analyzers" Version="1.21.0" />
<PackageVersion Include="NSubstitute.Analyzers.CSharp" Version="1.0.17" />
<PackageVersion Include="GitHubActionsTestLogger" Version="2.4.1" />
<PackageVersion Include="LiquidTestReports.Custom" Version="1.0.9" />
</ItemGroup>
</Project>
39 changes: 0 additions & 39 deletions GitHubIssueFormsParser/GitHubIssueFormsParser.sln

This file was deleted.

8 changes: 8 additions & 0 deletions GitHubIssueFormsParser/GitHubIssueFormsParser.slnx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Solution>
<Folder Name="/src/">
<Project Path="src/GitHubIssuesParserCli/GitHubIssuesParserCli.csproj" />
</Folder>
<Folder Name="/tests/">
<Project Path="tests/GitHubIssuesParserCli.Tests/GitHubIssuesParserCli.Tests.csproj" />
</Folder>
</Solution>
4 changes: 2 additions & 2 deletions GitHubIssueFormsParser/global.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"sdk": {
"version": "8.0.x",
"rollForward": "disable",
"version": "9.0.300",
"rollForward": "latestMinor",
"allowPrerelease": false
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

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

<ItemGroup>
<PackageReference Include="CliFx" Version="2.3.5" />
<PackageReference Include="SlugGenerator" Version="2.0.2" />
<PackageReference Include="YamlDotNet" Version="16.1.3" />
<PackageReference Include="CliFx" />
<PackageReference Include="SlugGenerator" />
<PackageReference Include="YamlDotNet" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ public IssueFormCheckBoxesText(string value)

private static List<IssueFormCheckboxOption> CreateCheckboxOptions(string options)
{
return options
.Split(new char[] { NewLines.CR, NewLines.LF }, StringSplitOptions.RemoveEmptyEntries)
var checkboxOptions = options
.Split([NewLines.CR, NewLines.LF], StringSplitOptions.RemoveEmptyEntries)
.Select(optionText =>
{
string label;
Expand Down Expand Up @@ -45,7 +45,7 @@ private static List<IssueFormCheckboxOption> CreateCheckboxOptions(string option
}

return new IssueFormCheckboxOption(label, isChecked);
})
.ToList();
});
return [.. checkboxOptions];
}
}
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject> <!-- This shouldn't be needed because it should be added by the Microsoft.NET.Test.Sdk package but for now it's required as explained here https://github.com/dotnet/sdk/issues/3790#issuecomment-1100773198 -->
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="xunit" />
<PackageReference Include="xunit.runner.visualstudio">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.2">
<PackageReference Include="coverlet.collector">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
8 changes: 4 additions & 4 deletions docs/dev-notes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@

### Building with Visual Studio

1) Clone the repo and open the **GitHubIssueFormsParser.sln** solution file at `/GitHubIssueFormsParser`.
1) Clone the repo and open the **GitHubIssueFormsParser.slnx** solution file at `/GitHubIssueFormsParser`.
2) Press build on Visual Studio.

### Building with dotnet CLI

1) Clone the repo and browse to the solution's directory at `/GitHubIssueFormsParser` using your favorite shell.
2) Run **`dotnet build GitHubIssueFormsParser.sln`** to build the source of the CLI app.
2) Run **`dotnet build GitHubIssueFormsParser.slnx`** to build the source of the CLI app.

## Running GitHubIssueFormsParser solution tests

### Run tests with Visual Studio

1) Clone the repo and open the **GitHubIssueFormsParser.sln** solution file at `/GitHubIssueFormsParser`.
1) Clone the repo and open the **GitHubIssueFormsParser.slnx** solution file at `/GitHubIssueFormsParser`.
2) Go to the test explorer in Visual Studio and run tests.

**Note:** [Remote testing](https://docs.microsoft.com/en-us/visualstudio/test/remote-testing?view=vs-2022) with is configured on the solution which enables you to run the tests locally on Linux or on Windows. You can view the configuration file at [testenvironments.json](/GitHubIssueFormsParser/testenvironments.json). To run the tests on Linux you need to have at least `Visual Studio 2022` and:
Expand All @@ -45,7 +45,7 @@
### Run tests with dotnet CLI

1) Clone the repo and browse to the solution's directory at `/GitHubIssueFormsParser` using your favorite shell.
2) Run **`dotnet test GitHubIssueFormsParser.sln`** to run tests.
2) Run **`dotnet test GitHubIssueFormsParser.slnx`** to run tests.

## Debugging the `GitHubIssuesParserCli` project using Visual Studio

Expand Down
Loading