diff --git a/.gitattributes b/.gitattributes index 56941f8..7da945c 100644 --- a/.gitattributes +++ b/.gitattributes @@ -13,4 +13,5 @@ *.cs text=auto diff=csharp *.csproj text=auto -*.sln text=auto eol=crlf \ No newline at end of file +*.sln text=auto eol=crlf +*.slnx text=auto eol=crlf \ No newline at end of file diff --git a/.github/markdown-link-check-config.json b/.github/markdown-link-check-config.json index 567749c..3c50c6a 100644 --- a/.github/markdown-link-check-config.json +++ b/.github/markdown-link-check-config.json @@ -22,5 +22,6 @@ }, "description": "Avoids 403s from GitHub docs" } - ] + ], + "aliveStatusCodes": [429, 200] } diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 594890a..25c6b17 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -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: diff --git a/Dockerfile b/Dockerfile index 4ba9d8f..c94d6ca 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 @@ -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" diff --git a/GitHubIssueFormsParser/.editorconfig b/GitHubIssueFormsParser/.editorconfig index ead2921..6454f02 100644 --- a/GitHubIssueFormsParser/.editorconfig +++ b/GitHubIssueFormsParser/.editorconfig @@ -26,7 +26,7 @@ trim_trailing_whitespace = true ########################################## # Visual Studio Solution Files -[*.sln] +[*.{sln,slnx}] indent_style = tab # Visual Studio XML Project Files @@ -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 @@ -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 diff --git a/GitHubIssueFormsParser/Directory.Build.props b/GitHubIssueFormsParser/Directory.Build.props index bbb89c0..f04b7c1 100644 --- a/GitHubIssueFormsParser/Directory.Build.props +++ b/GitHubIssueFormsParser/Directory.Build.props @@ -41,43 +41,46 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + diff --git a/GitHubIssueFormsParser/Directory.Packages.props b/GitHubIssueFormsParser/Directory.Packages.props new file mode 100644 index 0000000..b933aac --- /dev/null +++ b/GitHubIssueFormsParser/Directory.Packages.props @@ -0,0 +1,28 @@ + + + + true + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/GitHubIssueFormsParser/GitHubIssueFormsParser.sln b/GitHubIssueFormsParser/GitHubIssueFormsParser.sln deleted file mode 100644 index dd185bb..0000000 --- a/GitHubIssueFormsParser/GitHubIssueFormsParser.sln +++ /dev/null @@ -1,39 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.0.32014.148 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{C68997ED-6F39-4CE0-B525-F49D26EEF6F1}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{EB24C11E-ADD7-46F1-B96F-76CD399083F9}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GitHubIssuesParserCli", "src\GitHubIssuesParserCli\GitHubIssuesParserCli.csproj", "{F88B6DE9-79FA-4E66-89CB-7A1103E4068C}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitHubIssuesParserCli.Tests", "tests\GitHubIssuesParserCli.Tests\GitHubIssuesParserCli.Tests.csproj", "{DDD862B1-0716-46B8-88EC-7C8250B8F27B}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {F88B6DE9-79FA-4E66-89CB-7A1103E4068C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F88B6DE9-79FA-4E66-89CB-7A1103E4068C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F88B6DE9-79FA-4E66-89CB-7A1103E4068C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F88B6DE9-79FA-4E66-89CB-7A1103E4068C}.Release|Any CPU.Build.0 = Release|Any CPU - {DDD862B1-0716-46B8-88EC-7C8250B8F27B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DDD862B1-0716-46B8-88EC-7C8250B8F27B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DDD862B1-0716-46B8-88EC-7C8250B8F27B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DDD862B1-0716-46B8-88EC-7C8250B8F27B}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {F88B6DE9-79FA-4E66-89CB-7A1103E4068C} = {C68997ED-6F39-4CE0-B525-F49D26EEF6F1} - {DDD862B1-0716-46B8-88EC-7C8250B8F27B} = {EB24C11E-ADD7-46F1-B96F-76CD399083F9} - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {E25122DA-2DCA-4C8B-B972-036AB2707577} - EndGlobalSection -EndGlobal diff --git a/GitHubIssueFormsParser/GitHubIssueFormsParser.slnx b/GitHubIssueFormsParser/GitHubIssueFormsParser.slnx new file mode 100644 index 0000000..6f3cd01 --- /dev/null +++ b/GitHubIssueFormsParser/GitHubIssueFormsParser.slnx @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/GitHubIssueFormsParser/global.json b/GitHubIssueFormsParser/global.json index 1a11256..7062528 100644 --- a/GitHubIssueFormsParser/global.json +++ b/GitHubIssueFormsParser/global.json @@ -1,7 +1,7 @@ { "sdk": { - "version": "8.0.x", - "rollForward": "disable", + "version": "9.0.300", + "rollForward": "latestMinor", "allowPrerelease": false } } diff --git a/GitHubIssueFormsParser/src/GitHubIssuesParserCli/GitHubIssuesParserCli.csproj b/GitHubIssueFormsParser/src/GitHubIssuesParserCli/GitHubIssuesParserCli.csproj index 081e3aa..2a3fa61 100644 --- a/GitHubIssueFormsParser/src/GitHubIssuesParserCli/GitHubIssuesParserCli.csproj +++ b/GitHubIssueFormsParser/src/GitHubIssuesParserCli/GitHubIssuesParserCli.csproj @@ -2,13 +2,13 @@ Exe - net8.0 + net9.0 - - - + + + diff --git a/GitHubIssueFormsParser/src/GitHubIssuesParserCli/IssueFormBodies/IssueFormItems/Checkboxes/IssueFormCheckBoxesText.cs b/GitHubIssueFormsParser/src/GitHubIssuesParserCli/IssueFormBodies/IssueFormItems/Checkboxes/IssueFormCheckBoxesText.cs index f888ebb..2de21cd 100644 --- a/GitHubIssueFormsParser/src/GitHubIssuesParserCli/IssueFormBodies/IssueFormItems/Checkboxes/IssueFormCheckBoxesText.cs +++ b/GitHubIssueFormsParser/src/GitHubIssuesParserCli/IssueFormBodies/IssueFormItems/Checkboxes/IssueFormCheckBoxesText.cs @@ -12,8 +12,8 @@ public IssueFormCheckBoxesText(string value) private static List 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; @@ -45,7 +45,7 @@ private static List CreateCheckboxOptions(string option } return new IssueFormCheckboxOption(label, isChecked); - }) - .ToList(); + }); + return [.. checkboxOptions]; } } diff --git a/GitHubIssueFormsParser/tests/GitHubIssuesParserCli.Tests/GitHubIssuesParserCli.Tests.csproj b/GitHubIssueFormsParser/tests/GitHubIssuesParserCli.Tests/GitHubIssuesParserCli.Tests.csproj index d28cc70..208cbc1 100644 --- a/GitHubIssueFormsParser/tests/GitHubIssuesParserCli.Tests/GitHubIssuesParserCli.Tests.csproj +++ b/GitHubIssueFormsParser/tests/GitHubIssuesParserCli.Tests/GitHubIssuesParserCli.Tests.csproj @@ -1,19 +1,19 @@ - net8.0 + net9.0 false true - - - + + + runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/docs/dev-notes/README.md b/docs/dev-notes/README.md index d0cb07d..4418684 100644 --- a/docs/dev-notes/README.md +++ b/docs/dev-notes/README.md @@ -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: @@ -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