From 26ad55d263fbbb05b806f79114c5552165a0ee21 Mon Sep 17 00:00:00 2001 From: Irina Batinic <117161143+irina-batinic-sonarsource@users.noreply.github.com> Date: Wed, 26 Jun 2024 15:57:09 +0200 Subject: [PATCH] [NO JIRA] Stop adding new rule to check list in generate-rule script (#4828) --- java-checks/generate-rule-stubs.main.kts | 26 ------------------------ 1 file changed, 26 deletions(-) diff --git a/java-checks/generate-rule-stubs.main.kts b/java-checks/generate-rule-stubs.main.kts index b9a3765fd87..f120dd97c54 100755 --- a/java-checks/generate-rule-stubs.main.kts +++ b/java-checks/generate-rule-stubs.main.kts @@ -127,32 +127,6 @@ samplePath.writeText( """.trimIndent() ) -// Add check to check list -val checkListPath = listOf("..", "sonar-java-plugin", "src", "main", "java", "org", "sonar", "plugins", "java", "CheckList.java") - .fold(javaChecksModulePath) { acc, part -> - acc.resolve(part) - } - -val remainingLines = checkListPath.readLines().toMutableList() -val newLines = mutableListOf() - -while (!remainingLines.first().startsWith("import")) newLines.add(remainingLines.removeFirst()) - -val newCheckImportLine = "import ${pckg.joinToString(".")}.${checkName};" -while (remainingLines.first() - .startsWith("import") && remainingLines.first().lowercase() < newCheckImportLine.lowercase() -) newLines.add(remainingLines.removeFirst()) -newLines.add(newCheckImportLine) - -while (newLines.isEmpty() || !newLines.last().contains("// IssuableSubscriptionVisitor")) newLines.add(remainingLines.removeFirst()) - -val checkListLine = " $checkName.class," -while (remainingLines.first().endsWith(".class,") && remainingLines.first().lowercase() < checkListLine.lowercase()) newLines.add(remainingLines.removeFirst()) -newLines.add(checkListLine) - -newLines.addAll(remainingLines) - -checkListPath.writeText(newLines.joinToString("\n", postfix = "\n")) // License headers using "mvn license:format" val mvnCmd = if (System.getProperty("os.name").lowercase().startsWith("windows")) {