Skip to content

Commit 46fbf1d

Browse files
committed
format kotlin
1 parent baf101b commit 46fbf1d

File tree

3 files changed

+23
-18
lines changed

3 files changed

+23
-18
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
###### org.hypertrace.code-style-plugin
44

5-
[![CircleCI](https://circleci.com/gh/hypertrace/hypertrace-gradle-code-style-plugin.svg?style=svg)](https://circleci.com/gh/hypertrace/hypertrace-gradle-code-style-plugin)
65
### Purpose
76
This plugin configures the code style task for the entire project task in the project.
87

build.gradle.kts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
11
import org.hypertrace.gradle.publishing.License.APACHE_2_0
22

33
plugins {
4-
`java-gradle-plugin`
5-
id("org.hypertrace.ci-utils-plugin") version "0.1.1"
6-
id("org.hypertrace.publish-plugin") version "0.3.1"
4+
`java-gradle-plugin`
5+
id("org.hypertrace.ci-utils-plugin") version "0.1.1"
6+
id("org.hypertrace.publish-plugin") version "0.3.1"
77
}
88

99
group = "org.hypertrace.gradle.code.style"
1010

1111
java {
12-
targetCompatibility = JavaVersion.VERSION_1_8
13-
sourceCompatibility = JavaVersion.VERSION_1_8
12+
targetCompatibility = JavaVersion.VERSION_1_8
13+
sourceCompatibility = JavaVersion.VERSION_1_8
1414
}
1515

1616
repositories {
17-
mavenCentral()
17+
mavenCentral()
1818
}
1919

2020
dependencies {
21-
compile("com.diffplug.spotless:spotless-plugin-gradle:5.11.0")
21+
api("com.diffplug.spotless:spotless-plugin-gradle:5.11.0")
2222
}
2323

2424
gradlePlugin {
25-
plugins {
26-
create("gradlePlugin") {
27-
id = "org.hypertrace.code-style-plugin"
28-
implementationClass = "org.hypertrace.gradle.code.style.CodeStylePlugin"
29-
}
25+
plugins {
26+
create("gradlePlugin") {
27+
id = "org.hypertrace.code-style-plugin"
28+
implementationClass = "org.hypertrace.gradle.code.style.CodeStylePlugin"
3029
}
30+
}
3131
}
3232

3333
hypertracePublish {
34-
license.set(APACHE_2_0)
34+
license.set(APACHE_2_0)
3535
}

src/main/java/org/hypertrace/gradle/code/style/CodeStylePlugin.java

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import com.diffplug.gradle.spotless.SpotlessExtension;
44
import com.diffplug.gradle.spotless.SpotlessPlugin;
5-
import java.util.Map;
5+
import java.util.HashMap;
66
import javax.annotation.Nonnull;
77
import org.gradle.api.Plugin;
88
import org.gradle.api.Project;
@@ -34,9 +34,15 @@ private void configureFormatting(SpotlessExtension spotlessExtension) {
3434
});
3535

3636
spotlessExtension.kotlin(
37-
format -> {
38-
format.ktlint().userData(Map.of("indent_size", "2", "continuation_indent_size", "2"));
39-
});
37+
format -> format
38+
.ktlint()
39+
.userData(
40+
new HashMap<String, String>() {
41+
{
42+
put("indent_size", "2");
43+
put("continuation_indent_size", "2");
44+
}
45+
}));
4046

4147
spotlessExtension.format(
4248
"misc,",

0 commit comments

Comments
 (0)