add: spotless

This commit is contained in:
Shivam Goyal
2022-09-21 17:40:35 +05:30
parent ded3a6d657
commit e997683fa6
2 changed files with 35 additions and 4 deletions

View File

@@ -36,6 +36,12 @@ buildscript {
apply from: 'dependencies.gradle'
}
plugins {
id('com.diffplug.spotless') version('6.11.0')
}
apply from: "$project.rootDir/spotless.gradle"
allprojects {
repositories {
google()
@@ -93,7 +99,3 @@ allprojects {
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}

29
spotless.gradle Normal file
View File

@@ -0,0 +1,29 @@
/*
*
* * Copyright © 2022 by Navi Technologies Limited
* * All rights reserved. Strictly confidential
*
*/
spotless {
// optional: limit format enforcement to just the files changed by this feature branch
ratchetFrom 'origin/development'
format 'misc', {
// define the files to apply `misc` to
target '**/*.gradle', '**/*.md', '**/.gitignore'
// define the steps to apply to those files
indentWithSpaces()
trimTrailingWhitespace()
endWithNewline()
}
kotlin {
target '**/*.kt'
ktlint()
trimTrailingWhitespace()
indentWithSpaces()
endWithNewline()
}
}