Skip to content

Commit 26ad55d

Browse files
[NO JIRA] Stop adding new rule to check list in generate-rule script (#4828)
1 parent ea6136f commit 26ad55d

1 file changed

Lines changed: 0 additions & 26 deletions

File tree

java-checks/generate-rule-stubs.main.kts

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -127,32 +127,6 @@ samplePath.writeText(
127127
""".trimIndent()
128128
)
129129

130-
// Add check to check list
131-
val checkListPath = listOf("..", "sonar-java-plugin", "src", "main", "java", "org", "sonar", "plugins", "java", "CheckList.java")
132-
.fold(javaChecksModulePath) { acc, part ->
133-
acc.resolve(part)
134-
}
135-
136-
val remainingLines = checkListPath.readLines().toMutableList()
137-
val newLines = mutableListOf<String>()
138-
139-
while (!remainingLines.first().startsWith("import")) newLines.add(remainingLines.removeFirst())
140-
141-
val newCheckImportLine = "import ${pckg.joinToString(".")}.${checkName};"
142-
while (remainingLines.first()
143-
.startsWith("import") && remainingLines.first().lowercase() < newCheckImportLine.lowercase()
144-
) newLines.add(remainingLines.removeFirst())
145-
newLines.add(newCheckImportLine)
146-
147-
while (newLines.isEmpty() || !newLines.last().contains("// IssuableSubscriptionVisitor")) newLines.add(remainingLines.removeFirst())
148-
149-
val checkListLine = " $checkName.class,"
150-
while (remainingLines.first().endsWith(".class,") && remainingLines.first().lowercase() < checkListLine.lowercase()) newLines.add(remainingLines.removeFirst())
151-
newLines.add(checkListLine)
152-
153-
newLines.addAll(remainingLines)
154-
155-
checkListPath.writeText(newLines.joinToString("\n", postfix = "\n"))
156130

157131
// License headers using "mvn license:format"
158132
val mvnCmd = if (System.getProperty("os.name").lowercase().startsWith("windows")) {

0 commit comments

Comments
 (0)