Skip to content

Commit

Permalink
start work on spotless -> checkstyle conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
fabianmakila committed Sep 27, 2024
1 parent 0405175 commit 64f39ec
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 11 deletions.
15 changes: 4 additions & 11 deletions buildSrc/src/main/kotlin/webhooklogger.java-conventions.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
java
id("com.diffplug.spotless")
checkstyle
}

group = rootProject.group
Expand All @@ -12,17 +12,10 @@ java.toolchain {
}

tasks {
build {
dependsOn(checkstyleMain)
}
compileJava {
options.encoding = "UTF-8"
}
}

spotless {
java {
endWithNewline()
formatAnnotations()
indentWithTabs()
removeUnusedImports()
trimTrailingWhitespace()
}
}
35 changes: 35 additions & 0 deletions config/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
"https://checkstyle.org/dtds/configuration_1_3.dtd">

<module name="Checker">
<property name="charset" value="UTF-8"/>

<module name="TreeWalker">
<!-- Annotations -->
<module name="MissingOverride"/>

<!-- Block Checks -->
<module name="AvoidNestedBlocks"/>
<module name="EmptyBlock"/>
<module name="EmptyCatchBlock"/>
<module name="LeftCurly"/>
<module name="NeedBraces"/>
<module name="RightCurly"/>

<!-- Class Design -->
<module name="FinalClass"/>

<module name="RegexpSinglelineJava">
<property name="format" value="^\t* "/>
<property name="message" value="Indent must use tab characters"/>
<property name="ignoreComments" value="true"/>
</module>

<!-- Imports -->
<module name="IllegalImport"/>
<module name="RedundantImport"/>
<module name="UnusedImports"/>
</module>
</module>

0 comments on commit 64f39ec

Please sign in to comment.