Skip to content

Commit 1c35b1e

Browse files
committed
Add Spotless linter
1 parent 0938cb1 commit 1c35b1e

3 files changed

Lines changed: 19 additions & 1 deletion

File tree

build.gradle

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ buildscript {
1111

1212
plugins {
1313
id 'com.matthewprenger.cursegradle' version '1.4.0'
14+
id 'com.diffplug.spotless' version '5.14.3'
1415
}
1516

1617
apply plugin: 'net.minecraftforge.gradle'
@@ -288,3 +289,13 @@ idea {
288289
}
289290
}
290291
}
292+
293+
spotless {
294+
java {
295+
target 'src/*/java/org/cyclops/**/*.java'
296+
297+
endWithNewline()
298+
trimTrailingWhitespace()
299+
removeUnusedImports()
300+
}
301+
}

gradle.properties

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,10 @@ cyclopscore_version=1.12.1-100
55
release_type=release
66
fingerprint=bd0353b3e8a2810d60dd584e256e364bc3bedd44
77

8+
# Workaround for Spotless bug
9+
# https://github.com/diffplug/spotless/issues/834
10+
org.gradle.jvmargs=--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \
11+
--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \
12+
--add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED \
13+
--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \
14+
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED

src/main/java/org/cyclops/structuredcrafting/GeneralConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public class GeneralConfig extends DummyConfig {
2929
public GeneralConfig() {
3030
super(StructuredCrafting._instance, "general");
3131
}
32-
32+
3333
@Override
3434
public void onRegistered() {
3535
getMod().putGenericReference(ModBase.REFKEY_CRASH_ON_INVALID_RECIPE, GeneralConfig.crashOnInvalidRecipe);

0 commit comments

Comments
 (0)