Skip to content

Commit

Permalink
makes gradle spotless formatting apply to all sub modules of the core…
Browse files Browse the repository at this point in the history
… repo as well
  • Loading branch information
rishabhpoddar committed Nov 23, 2022
1 parent 1f5bbff commit e602843
Showing 1 changed file with 25 additions and 23 deletions.
48 changes: 25 additions & 23 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

buildscript {
repositories {
mavenCentral()
Expand All @@ -18,28 +17,31 @@ dependencies {
}

spotless {
// optional: limit format enforcement to just the files changed by this feature branch
// optional: limit format enforcement to just the files changed by this feature branch
// ratchetFrom 'origin/master'

format 'misc', {
// define the files to apply `misc` to
target '*.gradle', '*.md', '.gitignore'

// define the steps to apply to those files
trimTrailingWhitespace()
indentWithSpaces() // or tabs. Takes an integer argument if you don't like 4
endWithNewline()
}
java {
// Inferring targets won't work here
target 'supertokens-*/src/**/*.java'

eclipse().configFile("${project.rootDir}/.idea/codeStyles/spotless.eclipseformat.xml")
// apply a specific flavor of google-java-format
// googleJavaFormat('1.8').aosp().reflowLongStrings()
// make sure every file has the following copyright header.
// optionally, Spotless can set copyright years by digging
// through git history (see "license" section below)
// licenseHeader '/* (C)$YEAR */'
}
format 'misc', {
// define the files to apply `misc` to
target '*.gradle', '*.md', '.gitignore'

// define the steps to apply to those files
trimTrailingWhitespace()
indentWithSpaces() // or tabs. Takes an integer argument if you don't like 4
endWithNewline()
}
java {
// Inferring targets won't work here
target 'supertokens-*/src/**/*.java'
target 'supertokens-*/ee/src/**/*.java'
target 'supertokens-*/downloader/src/**/*.java'
target 'supertokens-*/cli/src/**/*.java'

eclipse().configFile("${project.rootDir}/.idea/codeStyles/spotless.eclipseformat.xml")
// apply a specific flavor of google-java-format
// googleJavaFormat('1.8').aosp().reflowLongStrings()
// make sure every file has the following copyright header.
// optionally, Spotless can set copyright years by digging
// through git history (see "license" section below)
// licenseHeader '/* (C)$YEAR */'
}
}

0 comments on commit e602843

Please sign in to comment.