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
10 changes: 0 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,6 @@ RUN ln -s /opt/microsoft/powershell/7/pwsh /usr/bin/pwsh
# end of install powershell

FROM mcr.microsoft.com/dotnet/sdk:7.0-alpine AS build
#############
# temp fix due to sdk 7.0.201 using a preview version of msbuild
# installing sdk 7.0.103 which doesn't have this problem
#############
RUN apk update && apk upgrade && apk add bash
RUN wget https://dot.net/v1/dotnet-install.sh && chmod +x ./dotnet-install.sh
ENV DOTNET_INSTALL_FOLDER=/usr/share/dotnet
RUN ./dotnet-install.sh --version 7.0.103 --install-dir ${DOTNET_INSTALL_FOLDER}
############# the above block can be deleted when the SDK issue has been resolved

WORKDIR /markdown-link-check-log-parser
COPY ["MarkdownLinkCheckLogParser/NuGet.Config", "MarkdownLinkCheckLogParser/"]
COPY ["MarkdownLinkCheckLogParser/src/MarkdownLinkCheckLogParserCli/MarkdownLinkCheckLogParserCli.csproj", "MarkdownLinkCheckLogParser/src/MarkdownLinkCheckLogParserCli/"]
Expand Down
3 changes: 2 additions & 1 deletion MarkdownLinkCheckLogParser/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ dotnet_naming_rule.stylecop_constant_fields_must_be_pascal_case_rule.severity

# All static readonly fields must be PascalCase
# https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1311.md
dotnet_naming_symbols.stylecop_static_readonly_fields_group.applicable_accessibilities = public, internal, protected_internal, protected, private_protected, private
dotnet_naming_symbols.stylecop_static_readonly_fields_group.applicable_accessibilities = public, internal, protected_internal, protected, private_protected
dotnet_naming_symbols.stylecop_static_readonly_fields_group.required_modifiers = static, readonly
dotnet_naming_symbols.stylecop_static_readonly_fields_group.applicable_kinds = field
dotnet_naming_rule.stylecop_static_readonly_fields_must_be_pascal_case_rule.symbols = stylecop_static_readonly_fields_group
Expand Down Expand Up @@ -512,6 +512,7 @@ dotnet_diagnostic.SA1116.severity = none # SA1116: The parameters should
dotnet_diagnostic.SA1200.severity = none # SA1200: Using directive should appear within a namespace declaration
dotnet_diagnostic.SA1201.severity = none # SA1201: A property should not follow a method
dotnet_diagnostic.SA1202.severity = none # SA1202: 'public' members should come before 'private' members
dotnet_diagnostic.SA1204.severity = none # SA1204: Static members should appear before non-static members
dotnet_diagnostic.SA1214.severity = none # SA1214: Readonly fields should appear before non-readonly fields
# Naming Rules (SA1300-)
dotnet_diagnostic.SA1309.severity = none # SA1309: Field should not begin with an underscore
Expand Down
16 changes: 9 additions & 7 deletions MarkdownLinkCheckLogParser/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<ContinuousIntegrationBuild Condition="'$(GITHUB_ACTIONS)' == 'true'">true</ContinuousIntegrationBuild> <!-- Enable deterministic builds as per https://github.com/clairernovotny/DeterministicBuilds. Recommended when using sourcelink -->
<WarningsAsErrors>nullable;</WarningsAsErrors> <!-- treat all nullable reference warnings as errors -->
<AnalysisLevel>latest</AnalysisLevel> <!-- Use the latest code analyzers that have been released are used. https://docs.microsoft.com/en-us/dotnet/core/project-sdk/msbuild-props#analysislevel -->
<AnalysisMode>AllEnabledByDefault</AnalysisMode> <!-- Aggressive or opt-out mode, where all rules are enabled by default as build warnings. https://docs.microsoft.com/en-us/dotnet/core/project-sdk/msbuild-props#analysismode -->
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild> <!-- Force code analysis to run on build. If this starts to slow down the build or Visual Studio consider enabling it only in CI. https://docs.microsoft.com/en-us/dotnet/core/project-sdk/msbuild-props#enforcecodestyleinbuild -->
<EnableNETAnalyzers>true</EnableNETAnalyzers> <!-- .NET code quality analysis is only enabled by default for projects that target .NET 5.0 or later. https://docs.microsoft.com/en-us/dotnet/core/project-sdk/msbuild-props#enablenetanalyzers -->
<!-- Enable deterministic builds as per https://github.com/clairernovotny/DeterministicBuilds. Recommended when using sourcelink -->
<ContinuousIntegrationBuild Condition="'$(GITHUB_ACTIONS)' == 'true'">true</ContinuousIntegrationBuild>
<!-- treat all nullable reference warnings as errors -->
<WarningsAsErrors>nullable;</WarningsAsErrors>
<!-- Aggressive or opt-out mode, where all rules are enabled by default as build warnings. https://docs.microsoft.com/en-us/dotnet/core/project-sdk/msbuild-props#analysismode -->
<AnalysisMode>AllEnabledByDefault</AnalysisMode>
<!-- Force code analysis to run on build. If this starts to slow down the build or Visual Studio consider enabling it only in CI. https://docs.microsoft.com/en-us/dotnet/core/project-sdk/msbuild-props#enforcecodestyleinbuild -->
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
</PropertyGroup>

<ItemGroup>
Expand Down Expand Up @@ -43,7 +45,7 @@
<PackageReference Include="Shouldly" Version="4.2.1" />
<PackageReference Include="xunit.analyzers" Version="1.1.0" />
<PackageReference Include="NSubstitute.Analyzers.CSharp" Version="1.0.16" />
<PackageReference Include="GitHubActionsTestLogger" Version="2.0.1" />
<PackageReference Include="GitHubActionsTestLogger" Version="2.1.0" />
<PackageReference Include="LiquidTestReports.Custom" Version="1.0.9" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion MarkdownLinkCheckLogParser/global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "7.0.103",
"version": "7.0.x",
"rollForward": "disable",
"allowPrerelease": false
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@ namespace MarkdownLinkCheckLogParserCli.ArgumentValidations;

internal static class Argument
{
public static int Positive(this int value, [CallerArgumentExpression("value")] string name = "")
public static int Positive(this int value, [CallerArgumentExpression(nameof(value))] string name = "")
{
var message = $"{name} must be a positive value.";
return value >= 0
? value
: throw new ArgumentException(message);
}

public static T NotNull<T>([NotNull] this T? value, [CallerArgumentExpression("value")] string name = "")
public static T NotNull<T>([NotNull] this T? value, [CallerArgumentExpression(nameof(value))] string name = "")
where T : class
{
return value ?? throw new ArgumentNullException(name);
}

internal static string NotNullOrWhiteSpace([NotNull] this string? value, [CallerArgumentExpression("value")] string name = "")
internal static string NotNullOrWhiteSpace([NotNull] this string? value, [CallerArgumentExpression(nameof(value))] string name = "")
{
var message = $"{name} cannot be null or whitespace.";
return string.IsNullOrWhiteSpace(value)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public static LineSplitEnumerator SplitLines(this Memory<char> memory)
return new LineSplitEnumerator(memory);
}

public struct LineSplitEnumerator
public sealed class LineSplitEnumerator
{
private ReadOnlyMemory<char> _str;

Expand Down
7 changes: 6 additions & 1 deletion MarkdownLinkCheckLogParser/testenvironments.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@
"version": "1",
"environments": [
{
"name": "WSL-Ubuntu-22.04",
"name": "WSL Ubuntu 22.04",
"type": "wsl",
"wslDistribution": "Ubuntu-22.04"
},
{
"name": "docker Ubuntu 22.04",
"type": "docker",
"dockerFile": "tests/remote-test-environment.Dockerfile"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# use same linux distro as github runner for ubuntu-latest which is what the workflows use
FROM mcr.microsoft.com/dotnet/sdk:7.0-jammy
2 changes: 1 addition & 1 deletion docs/dev-notes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ This action is published to the [GitHub marketplace](https://github.com/marketpl

When publishing a new version:

- create a new tag for the release and update the latest major tag to the same commit as the new tag.
- create a new tag (like v1.0.4) for the release and update the latest major tag (like v1) to the same commit as the new tag.
- the docker image tag for `docker://ghcr.io/edumserrano/markdown-link-check-log-parser` in the [action.yml](/action.yml) file needs to be updated to a new major version if a new major version has been published.

Once a new tag is pushed the workflow to publish a docker image will execute and publish a docker image to GitHub packages that will contain a docker image tag that matches the new GitHub tag.
Expand Down