From a5c0aa3c4c591af8dbf0ac894c608fc290b457ab Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Nov 2024 08:45:47 +0100 Subject: [PATCH 1/2] Bump DavidAnson/markdownlint-cli2-action from 17 to 18 (#141) Bumps [DavidAnson/markdownlint-cli2-action](https://github.com/davidanson/markdownlint-cli2-action) from 17 to 18. - [Release notes](https://github.com/davidanson/markdownlint-cli2-action/releases) - [Commits](https://github.com/davidanson/markdownlint-cli2-action/compare/v17...v18) --- updated-dependencies: - dependency-name: DavidAnson/markdownlint-cli2-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 32d35d0a..142acd99 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -46,7 +46,7 @@ jobs: name: Markdown Lint runs-on: ubuntu-latest steps: - - uses: DavidAnson/markdownlint-cli2-action@v17 + - uses: DavidAnson/markdownlint-cli2-action@v18 with: globs: '**/*.md' From 9369da8639329d28283550452fc702f7f25f3124 Mon Sep 17 00:00:00 2001 From: Sebastiaan Speck <12570668+sebastiaanspeck@users.noreply.github.com> Date: Mon, 18 Nov 2024 08:49:16 +0100 Subject: [PATCH 2/2] Respect DisabledByDefault for a check which is not explicitly enabled (#131) --- .../nl/ramsolutions/sw/magik/checks/CheckList.java | 11 ----------- .../sw/magik/checks/MagikChecksConfiguration.java | 12 +++++++++--- .../ramsolutions/sw/magik/typedchecks/CheckList.java | 12 ------------ 3 files changed, 9 insertions(+), 26 deletions(-) diff --git a/magik-checks/src/main/java/nl/ramsolutions/sw/magik/checks/CheckList.java b/magik-checks/src/main/java/nl/ramsolutions/sw/magik/checks/CheckList.java index ed7224cf..34bbd829 100644 --- a/magik-checks/src/main/java/nl/ramsolutions/sw/magik/checks/CheckList.java +++ b/magik-checks/src/main/java/nl/ramsolutions/sw/magik/checks/CheckList.java @@ -110,15 +110,4 @@ public static List> getChecks() { getFixers() { return Map.of(FormattingCheck.class, List.of(FormattingFixer.class)); } - - /** - * Get {@link MagikCheck}s which are disabled by default. - * - * @return List of {@link MagikCheck}s. - */ - public static List> getDisabledByDefaultChecks() { - return getChecks().stream() - .filter(checkClass -> checkClass.getAnnotation(DisabledByDefault.class) != null) - .toList(); - } } diff --git a/magik-checks/src/main/java/nl/ramsolutions/sw/magik/checks/MagikChecksConfiguration.java b/magik-checks/src/main/java/nl/ramsolutions/sw/magik/checks/MagikChecksConfiguration.java index 7e1c3041..ea20b9c4 100644 --- a/magik-checks/src/main/java/nl/ramsolutions/sw/magik/checks/MagikChecksConfiguration.java +++ b/magik-checks/src/main/java/nl/ramsolutions/sw/magik/checks/MagikChecksConfiguration.java @@ -49,9 +49,15 @@ public List getAllChecks() { for (final Class checkClass : this.checkClasses) { final String checkKey = MagikChecksConfiguration.checkKey(checkClass); - final boolean checkEnabled = - enableds.contains(checkKey) - || !disableds.contains(checkKey) && !disableds.contains("all"); + final boolean checkEnabled; + if (enableds.contains(checkKey)) { + checkEnabled = true; + } else if (disableds.contains(checkKey) || disableds.contains("all")) { + checkEnabled = false; + } else { + // No explicit configuration, use default state + checkEnabled = checkClass.getAnnotation(DisabledByDefault.class) == null; + } // Gather parameters from MagikCheck, value from config. final Set parameters = diff --git a/magik-typed-checks/src/main/java/nl/ramsolutions/sw/magik/typedchecks/CheckList.java b/magik-typed-checks/src/main/java/nl/ramsolutions/sw/magik/typedchecks/CheckList.java index 3e50fbc7..157e6e11 100644 --- a/magik-typed-checks/src/main/java/nl/ramsolutions/sw/magik/typedchecks/CheckList.java +++ b/magik-typed-checks/src/main/java/nl/ramsolutions/sw/magik/typedchecks/CheckList.java @@ -2,7 +2,6 @@ import java.util.List; import java.util.Map; -import nl.ramsolutions.sw.magik.checks.DisabledByDefault; import nl.ramsolutions.sw.magik.checks.MagikCheck; import nl.ramsolutions.sw.magik.checks.checks.TypeDocCheck; import nl.ramsolutions.sw.magik.typedchecks.checks.ConditionalExpressionIsFalseTypedCheck; @@ -58,15 +57,4 @@ public static List> getChecks() { return Map.of( TypeDocCheck.class, List.of(TypeDocParameterFixer.class, TypeDocReturnTypeFixer.class)); } - - /** - * Get {@link MagikCheck}s which are disabled by default. - * - * @return List of {@link MagikCheck}s. - */ - public static List> getDisabledByDefaultChecks() { - return getChecks().stream() - .filter(checkClass -> checkClass.getAnnotation(DisabledByDefault.class) != null) - .toList(); - } }