Skip to content

Commit

Permalink
🎨 Introduce code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
CybAtax committed May 24, 2024
1 parent 6ca318e commit 68b0a06
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 6 deletions.
1 change: 1 addition & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# .git-blame-ignore-revs
6 changes: 6 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
* text=auto eol=lf

gradle/wrapper/gradle-wrapper.jar linguist-generated=true
gradle/wrapper/gradle-wrapper.properties linguist-generated=true
gradlew linguist-generated=true
gradlew.bat linguist-generated=true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ build/

### IntelliJ IDEA ###
.idea
!.idea/codeStyles
!.idea/icon.svg
5 changes: 5 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .prettierrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
plugins:
- prettier-plugin-java
parser: java
printWidth: 120
tabWidth: 4
singleQuote: false
useTabs: true
40 changes: 34 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,19 +1,47 @@
import java.nio.charset.StandardCharsets

plugins {
id 'java'
id 'java'
id 'com.diffplug.spotless' version '6.25.0'
}

group = 'de.trollteam'
version = '1.0-SNAPSHOT'

repositories {
mavenCentral()
mavenCentral()
}

dependencies {
testImplementation platform('org.junit:junit-bom:5.10.2')
testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation platform('org.junit:junit-bom:5.10.2')
testImplementation 'org.junit.jupiter:junit-jupiter'
}

test {
useJUnitPlatform()
}
useJUnitPlatform()
}

spotless {
enforceCheck(false)
ratchetFrom "origin/main"

format "misc", {
target fileTree(".") {
exclude(".gradle", ".idea/", "build/", "gradle/", "src/")
}

encoding(StandardCharsets.UTF_8)
trimTrailingWhitespace()
indentWithTabs()
endWithNewline()
}

java {
target "src/**/java/**/*.java"
encoding(StandardCharsets.UTF_8)
removeUnusedImports()
prettier(["prettier": "3.0.3", "prettier-plugin-java": "2.3.0"])
.configFile(".prettierrc.yml")
}

}

0 comments on commit 68b0a06

Please sign in to comment.