aboutsummaryrefslogtreecommitdiff
path: root/buildSrc/src/main/java/Spotless.kt
diff options
context:
space:
mode:
Diffstat (limited to 'buildSrc/src/main/java/Spotless.kt')
-rw-r--r--buildSrc/src/main/java/Spotless.kt20
1 files changed, 20 insertions, 0 deletions
diff --git a/buildSrc/src/main/java/Spotless.kt b/buildSrc/src/main/java/Spotless.kt
new file mode 100644
index 00000000..1422e12b
--- /dev/null
+++ b/buildSrc/src/main/java/Spotless.kt
@@ -0,0 +1,20 @@
+/*
+ * Copyright © 2014-2021 The Android Password Store Authors. All Rights Reserved.
+ * SPDX-License-Identifier: GPL-3.0-only
+ */
+
+import com.diffplug.gradle.spotless.SpotlessExtension
+
+internal fun SpotlessExtension.configureSpotless() {
+ ratchetFrom = "origin/develop"
+ kotlin {
+ ktfmt().googleStyle()
+ target("src/**/*.kt", "**/*.kts")
+ }
+ format("xml") {
+ target("**/*.xml")
+ trimTrailingWhitespace()
+ indentWithSpaces()
+ endWithNewline()
+ }
+}