Skip to content

Commit 7ef4cc0

Browse files
authored
ktlint: Fix formatting task when running on JDK 16+ (#239)
1 parent 42ea644 commit 7ef4cc0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/main/kotlin/com/vanniktech/code/quality/tools/KtLintFormatTask.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ internal abstract class KtLintFormatWorker @Inject internal constructor(
5858
task.args("--experimental")
5959
}
6060

61+
// Required for JDK 16 or later.
62+
// https://github.com/pinterest/ktlint/issues/1195#issuecomment-1009027802
63+
task.jvmArgs("--add-opens", "java.base/java.lang=ALL-UNNAMED")
64+
6165
task.args(
6266
"--reporter=plain",
6367
"--reporter=checkstyle,output=${File(parameters.outputDirectory.asFile.get(), "ktlint-checkstyle-report.xml")}",

0 commit comments

Comments
 (0)