From e997683fa65b2be89d7762d14428ab42617dbb07 Mon Sep 17 00:00:00 2001 From: Shivam Goyal Date: Wed, 21 Sep 2022 17:40:35 +0530 Subject: [PATCH] add: spotless --- build.gradle | 10 ++++++---- spotless.gradle | 29 +++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 4 deletions(-) create mode 100644 spotless.gradle 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() + } +}