From 16497255b2937b77c05bf02a7cc526fed4ef3034 Mon Sep 17 00:00:00 2001 From: Wei-Qiang Zhou Date: Thu, 20 Aug 2026 11:33:28 +0200 Subject: [PATCH] Remove PMD, Checkstyle and Spotless Signed-off-by: Wei-Qiang Zhou --- build.gradle | 44 -- config/checkstyle/checkstyle_main.xml | 198 --------- config/checkstyle/checkstyle_test.xml | 186 --------- config/pmd/ruleset.xml | 61 --- config/spotless/code_style.xml | 380 ------------------ .../pgm/example/PowerGridModelExample.java | 5 - .../org/lfenergy/pgm/loader/PGMLoader.java | 2 - .../pgm/loader/ResourceLibraryLoader.java | 1 - .../lfenergy/pgm/loader/PGMLoaderTest.java | 2 - .../pgm/loader/PlatformDetectorTest.java | 2 - .../pgm/loader/ResourceLibraryLoaderTest.java | 2 - 11 files changed, 883 deletions(-) delete mode 100644 config/checkstyle/checkstyle_main.xml delete mode 100644 config/checkstyle/checkstyle_test.xml delete mode 100644 config/pmd/ruleset.xml delete mode 100644 config/spotless/code_style.xml diff --git a/build.gradle b/build.gradle index 0de00b2..d157c7e 100644 --- a/build.gradle +++ b/build.gradle @@ -7,7 +7,6 @@ import javax.inject.Inject plugins { id 'java' id 'maven-publish' - id("com.diffplug.spotless") version "8.9.0" } interface InjectedExecOps { @@ -22,49 +21,6 @@ repositories { mavenCentral() } -apply plugin: 'checkstyle' -apply plugin: 'pmd' - -checkstyle { - toolVersion = "13.5.0" - sourceSets = [project.sourceSets.main] -} - -checkstyleMain { - configFile = "${rootDir}/config/checkstyle/checkstyle_main.xml" as File -} - -checkstyleTest { - configFile = "${rootDir}/config/checkstyle/checkstyle_test.xml" as File -} - -pmd { - consoleOutput = true - toolVersion = '7.26.0' - ruleSetFiles = files("${rootDir}/config/pmd/ruleset.xml") -} - -pmdTest { - enabled = false -} - -tasks.named("pmdMain", Pmd) { - source = fileTree("src/main/java") -} - -spotless{ - java { - targetExclude("build/**") - toggleOffOn() - eclipse().configFile('config/spotless/code_style.xml') - - licenseHeader """// SPDX-FileCopyrightText: Contributors to the Power Grid Model project -// SPDX-License-Identifier: MPL-2.0 - -""" - } -} - def pgmVersion = "1.13.109" def pgmDir = layout.buildDirectory.dir("pgm").get() diff --git a/config/checkstyle/checkstyle_main.xml b/config/checkstyle/checkstyle_main.xml deleted file mode 100644 index a64f23d..0000000 --- a/config/checkstyle/checkstyle_main.xml +++ /dev/null @@ -1,198 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/config/checkstyle/checkstyle_test.xml b/config/checkstyle/checkstyle_test.xml deleted file mode 100644 index 25afb75..0000000 --- a/config/checkstyle/checkstyle_test.xml +++ /dev/null @@ -1,186 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/config/pmd/ruleset.xml b/config/pmd/ruleset.xml deleted file mode 100644 index 6067491..0000000 --- a/config/pmd/ruleset.xml +++ /dev/null @@ -1,61 +0,0 @@ - - - - PMD rules - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/config/spotless/code_style.xml b/config/spotless/code_style.xml deleted file mode 100644 index 66c6c5b..0000000 --- a/config/spotless/code_style.xml +++ /dev/null @@ -1,380 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/java/org/lfenergy/pgm/example/PowerGridModelExample.java b/src/main/java/org/lfenergy/pgm/example/PowerGridModelExample.java index 30fdd5f..ab57bca 100644 --- a/src/main/java/org/lfenergy/pgm/example/PowerGridModelExample.java +++ b/src/main/java/org/lfenergy/pgm/example/PowerGridModelExample.java @@ -18,7 +18,6 @@ *

* NOTE: The generated PowerGridModelC_1 class hardcodes the .so path at generation time. If the library has moved, re-run jextract or update SYMBOL_LOOKUP manually. */ -@SuppressWarnings("PMD.SystemPrintln") public final class PowerGridModelExample { private PowerGridModelExample() { @@ -41,10 +40,6 @@ static void main() { // ------------------------------------------------------------------------- - @SuppressWarnings({"checkstyle:MagicNumber", "checkstyle:MethodLength", - "PMD.NcssCount", - "PMD.CognitiveComplexity", - "PMD.VariableDeclarationUsageDistance"}) private static void runExample() { final MemorySegment handle = PowerGridModelC.PGM_create_handle(); diff --git a/src/main/java/org/lfenergy/pgm/loader/PGMLoader.java b/src/main/java/org/lfenergy/pgm/loader/PGMLoader.java index 713f7a7..8de2444 100644 --- a/src/main/java/org/lfenergy/pgm/loader/PGMLoader.java +++ b/src/main/java/org/lfenergy/pgm/loader/PGMLoader.java @@ -89,7 +89,6 @@ public void check(boolean matchVersion) { } } - @SuppressWarnings("PMD.AvoidCatchingGenericException") public String getPGMRuntimeVersion() { if (pgmRuntimeVersion.get() != null) { @@ -150,7 +149,6 @@ private String determineLibraryResourcePath(Platform platform) { /** * Interface that allows for mocking in unit tests. */ - @SuppressWarnings({"checkstyle:MethodName", "PMD.MethodNamingConventions"}) @FunctionalInterface interface PGMInvoker { diff --git a/src/main/java/org/lfenergy/pgm/loader/ResourceLibraryLoader.java b/src/main/java/org/lfenergy/pgm/loader/ResourceLibraryLoader.java index c132cee..1a055cd 100644 --- a/src/main/java/org/lfenergy/pgm/loader/ResourceLibraryLoader.java +++ b/src/main/java/org/lfenergy/pgm/loader/ResourceLibraryLoader.java @@ -88,7 +88,6 @@ void loadResourceLibrary(final String resourceLibraryPath) { * @throws PGMLoaderException if the resource file containing the native library cannot be found or opened, or if something unexpected happens * when copying the native library to a temporary file. */ - @SuppressWarnings("PMD.AvoidCatchingGenericException") private Path provideLoadableLibraryFromResources(final String resourceLibraryPath) { final URL resourceUrl = dependencies.openResource(resourceLibraryPath); diff --git a/src/test/java/org/lfenergy/pgm/loader/PGMLoaderTest.java b/src/test/java/org/lfenergy/pgm/loader/PGMLoaderTest.java index 03fe468..9d4667c 100644 --- a/src/test/java/org/lfenergy/pgm/loader/PGMLoaderTest.java +++ b/src/test/java/org/lfenergy/pgm/loader/PGMLoaderTest.java @@ -89,7 +89,6 @@ void testAutoload(Platform platform, assertEquals(expectedResourceFile, resourceLibraryLoaderCaptor.getValue()); } - // spotless:off static Stream testAutoloadProvider() { return Stream.of( @@ -116,7 +115,6 @@ static Stream testAutoloadProvider() { ) ); } - // spotless:on @Test void testCheckThrowsVersionMismatchExceptionWhenCheckingVersionAndVersionsNotEqual() { diff --git a/src/test/java/org/lfenergy/pgm/loader/PlatformDetectorTest.java b/src/test/java/org/lfenergy/pgm/loader/PlatformDetectorTest.java index 4503f64..c94b914 100644 --- a/src/test/java/org/lfenergy/pgm/loader/PlatformDetectorTest.java +++ b/src/test/java/org/lfenergy/pgm/loader/PlatformDetectorTest.java @@ -40,7 +40,6 @@ void test(String osName, assertEquals(expectedPlatform, actualPlatform); } - // spotless:off static Stream testProvider() { return Stream.of( @@ -82,5 +81,4 @@ static Stream testProvider() { ) ); } - // spotless:on } diff --git a/src/test/java/org/lfenergy/pgm/loader/ResourceLibraryLoaderTest.java b/src/test/java/org/lfenergy/pgm/loader/ResourceLibraryLoaderTest.java index e9c4503..9d86ff5 100644 --- a/src/test/java/org/lfenergy/pgm/loader/ResourceLibraryLoaderTest.java +++ b/src/test/java/org/lfenergy/pgm/loader/ResourceLibraryLoaderTest.java @@ -103,7 +103,6 @@ void testWhenResourceIsNotFile(String resourceLibraryPath) throws Exception { assertEquals(expectedPathString, systemLoadCaptor.getValue()); } - // spotless:off static Stream testProvider() { return Stream.of( @@ -114,5 +113,4 @@ static Stream testProvider() { Arguments.argumentSet("WINDOWS, X86_64", "/power_grid_model_c_x86_64_windows.dll") ); } - // spotless:on }