diff --git a/build.gradle b/build.gradle index 623b3d1bac..a3a373d9db 100644 --- a/build.gradle +++ b/build.gradle @@ -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 -} diff --git a/spotless.gradle b/spotless.gradle new file mode 100644 index 0000000000..3e0b928b05 --- /dev/null +++ b/spotless.gradle @@ -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() + } +}