File tree Expand file tree Collapse file tree 3 files changed +17
-9
lines changed
Expand file tree Collapse file tree 3 files changed +17
-9
lines changed Original file line number Diff line number Diff line change 11import com.diffplug.gradle.spotless.SpotlessExtension
2+ import com.diffplug.spotless.npm.PrettierFormatterStep
23import datadog.gradle.plugin.ci.testAggregate
34
45plugins {
@@ -39,10 +40,10 @@ with(extensions["spotlessPredeclare"] as SpotlessExtension) {
3940 googleJavaFormat(" 1.32.0" )
4041 }
4142 groovyGradle {
42- greclipse( )
43+ prettier( mapOf ( " prettier " to " 3.7.4 " , " prettier-plugin-groovy " to " 0.2.1 " ) )
4344 }
4445 groovy {
45- greclipse( )
46+ prettier( mapOf ( " prettier " to " 3.7.4 " , " prettier-plugin-groovy " to " 0.2.1 " ) )
4647 }
4748 kotlinGradle {
4849 ktlint(" 1.8.0" )
Original file line number Diff line number Diff line change 1+ # prettier-groovy.toml
2+ # Reads the .editorconfig file in the project root for base settings
3+
4+ plugins = [
5+ " prettier-plugin-groovy" , # https://www.npmjs.com/package/prettier-plugin-groovy
6+ ]
7+
8+ [[overrides ]]
9+ files = [" *.groovy" ]
10+ options = { parser = " groovy" }
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ def buildDirectoryFiles = project.layout.buildDirectory.asFileTree
99
1010spotless {
1111 if (rootProject. hasProperty(' skipSpotless' )) {
12+ logger. warn(" This property is going away, use standard Gradle options: '-x spotlessCheck' or '-x spotlessApply' to exclude spotless tasks" )
1213 // Spotless in JDK 8 uses an older eclipse formatter, and it has a (flaky) bug crashing check_profiling.
1314 // We disable it in CI, since we have a job dedicated to spotless anyway.
1415 enforceCheck false
@@ -37,7 +38,7 @@ spotless {
3738 } else {
3839 target ' *.gradle'
3940 }
40- greclipse( ). configFile(configPath + ' /enforcement/spotless -groovy.properties ' )
41+ prettier([ " prettier " : " 3.7.4 " , " prettier-plugin-groovy " : " 0.2.1 " ] ). configFile(configPath + ' /enforcement/prettier -groovy.toml ' )
4142 }
4243
4344 kotlinGradle {
@@ -54,13 +55,9 @@ spotless {
5455 project. pluginManager. withPlugin(' groovy' ) {
5556 groovy {
5657 toggleOffOn()
57- if (! groovySkipJavaExclude) {
58- excludeJava() // excludes all Java sources within the Groovy source dirs from formatting
59- // the Groovy Eclipse formatter extends the Java Eclipse formatter,
60- // so it formats Java files by default (unless `excludeJava` is used).
61- }
58+ target(" **/*.groovy" )
6259 targetExclude(buildDirectoryFiles)
63- greclipse( ). configFile(configPath + ' /enforcement/spotless -groovy.properties ' )
60+ prettier([ " prettier " : " 3.7.4 " , " prettier-plugin-groovy " : " 0.2.1 " ] ). configFile(configPath + ' /enforcement/prettier -groovy.toml ' )
6461 }
6562 }
6663
You can’t perform that action at this time.
0 commit comments