From a8288463451e6078b01458e7de3ee5b86294bc36 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Fri, 2 Sep 2022 22:04:02 +0530 Subject: Upgrade ktfmt and setup automatic updates (#2103) --- .github/renovate.json | 12 ++++++++++++ .../app/passwordstore/util/git/operation/GitOperation.kt | 12 +++++++++--- .../autofillparser/AutofillStrategyDsl.kt | 4 +++- .../main/kotlin/app/passwordstore/gradle/SpotlessPlugin.kt | 2 +- .../java/org/openintents/openpgp/OpenPgpSignatureResult.kt | 4 +++- 5 files changed, 28 insertions(+), 6 deletions(-) diff --git a/.github/renovate.json b/.github/renovate.json index 583a23dc..5b9d9cdd 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -8,5 +8,17 @@ "matchPackagePatterns": ["^kotlin", "^org.jetbrains.kotlin"], "groupName": "kotlin" } + ], + "regexManagers": [ + { + "fileMatch": [ + ".kt$" + ], + "matchStrings": [ + "KTFMT_VERSION = \"(?.*)\"" + ], + "datasourceTemplate": "maven", + "depNameTemplate": "com.facebook:ktfmt" + } ] } diff --git a/app/src/main/java/app/passwordstore/util/git/operation/GitOperation.kt b/app/src/main/java/app/passwordstore/util/git/operation/GitOperation.kt index 02cea621..1a4a62df 100644 --- a/app/src/main/java/app/passwordstore/util/git/operation/GitOperation.kt +++ b/app/src/main/java/app/passwordstore/util/git/operation/GitOperation.kt @@ -155,10 +155,14 @@ abstract class GitOperation(protected val callingActivity: FragmentActivity) { .setTitle(callingActivity.resources.getString(R.string.ssh_preferences_dialog_title)) .setPositiveButton( callingActivity.resources.getString(R.string.ssh_preferences_dialog_import) - ) { _, _ -> getSshKey(false) } + ) { _, _ -> + getSshKey(false) + } .setNegativeButton( callingActivity.resources.getString(R.string.ssh_preferences_dialog_generate) - ) { _, _ -> getSshKey(true) } + ) { _, _ -> + getSshKey(true) + } .setNeutralButton(callingActivity.resources.getString(R.string.dialog_cancel)) { _, _ -> // Finish the blank GitActivity so user doesn't have to press back callingActivity.finish() @@ -177,7 +181,9 @@ abstract class GitOperation(protected val callingActivity: FragmentActivity) { BiometricAuthenticator.authenticate( callingActivity, R.string.biometric_prompt_title_ssh_auth - ) { result -> if (result !is Failure) cont.resume(result) } + ) { result -> + if (result !is Failure) cont.resume(result) + } } } when (result) { diff --git a/autofill-parser/src/main/java/com/github/androidpasswordstore/autofillparser/AutofillStrategyDsl.kt b/autofill-parser/src/main/java/com/github/androidpasswordstore/autofillparser/AutofillStrategyDsl.kt index 35006468..94cef6e5 100644 --- a/autofill-parser/src/main/java/com/github/androidpasswordstore/autofillparser/AutofillStrategyDsl.kt +++ b/autofill-parser/src/main/java/com/github/androidpasswordstore/autofillparser/AutofillStrategyDsl.kt @@ -285,7 +285,9 @@ private constructor( FillableFieldType.NewPassword, ) } - ) { "Every rule block can only have either genericPassword or {current,new}Password blocks" } + ) { + "Every rule block can only have either genericPassword or {current,new}Password blocks" + } matchers.add( AutofillRuleMatcher( type = FillableFieldType.GenericPassword, diff --git a/build-logic/kotlin-plugins/src/main/kotlin/app/passwordstore/gradle/SpotlessPlugin.kt b/build-logic/kotlin-plugins/src/main/kotlin/app/passwordstore/gradle/SpotlessPlugin.kt index 76b50bf7..e0a2f699 100644 --- a/build-logic/kotlin-plugins/src/main/kotlin/app/passwordstore/gradle/SpotlessPlugin.kt +++ b/build-logic/kotlin-plugins/src/main/kotlin/app/passwordstore/gradle/SpotlessPlugin.kt @@ -39,6 +39,6 @@ class SpotlessPlugin : Plugin { } private companion object { - private const val KTFMT_VERSION = "0.39" + private const val KTFMT_VERSION = "0.40" } } diff --git a/openpgp-ktx/src/main/java/org/openintents/openpgp/OpenPgpSignatureResult.kt b/openpgp-ktx/src/main/java/org/openintents/openpgp/OpenPgpSignatureResult.kt index a310b3c9..a1a4a81b 100644 --- a/openpgp-ktx/src/main/java/org/openintents/openpgp/OpenPgpSignatureResult.kt +++ b/openpgp-ktx/src/main/java/org/openintents/openpgp/OpenPgpSignatureResult.kt @@ -242,7 +242,9 @@ public class OpenPgpSignatureResult : Parcelable { !(signatureStatus == RESULT_NO_SIGNATURE || signatureStatus == RESULT_KEY_MISSING || signatureStatus == RESULT_INVALID_SIGNATURE) - ) { "can only use this method for valid types of signatures" } + ) { + "can only use this method for valid types of signatures" + } return OpenPgpSignatureResult( signatureStatus, primaryUserId, -- cgit v1.2.3