diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
index a499eb18..a2af24b6 100644
--- a/.idea/codeStyles/Project.xml
+++ b/.idea/codeStyles/Project.xml
@@ -8,8 +8,6 @@
-
-
diff --git a/build-conventions/src/main/kotlin/zcash-sdk.ktlint-conventions.gradle.kts b/build-conventions/src/main/kotlin/zcash-sdk.ktlint-conventions.gradle.kts
index 99808b65..386fca8b 100644
--- a/build-conventions/src/main/kotlin/zcash-sdk.ktlint-conventions.gradle.kts
+++ b/build-conventions/src/main/kotlin/zcash-sdk.ktlint-conventions.gradle.kts
@@ -13,7 +13,7 @@ dependencies {
}
tasks {
- val editorConfigFile = rootProject.file(".editorconfig")
+ val editorConfigFile = rootProject.file("tools/.editorconfig")
val ktlintArgs = listOf("**/src/**/*.kt", "!**/build/**.kt", "--editorconfig=$editorConfigFile")
register("ktlint", org.gradle.api.tasks.JavaExec::class) {
diff --git a/darkside-test-lib/src/androidTest/java/cash/z/ecc/android/sdk/darkside/test/TestWallet.kt b/darkside-test-lib/src/androidTest/java/cash/z/ecc/android/sdk/darkside/test/TestWallet.kt
index 3977b079..947d3773 100644
--- a/darkside-test-lib/src/androidTest/java/cash/z/ecc/android/sdk/darkside/test/TestWallet.kt
+++ b/darkside-test-lib/src/androidTest/java/cash/z/ecc/android/sdk/darkside/test/TestWallet.kt
@@ -74,7 +74,7 @@ class TestWallet(
startHeight
)
as
- SdkSynchronizer
+ SdkSynchronizer
val service = (synchronizer.processor.downloader.lightWalletService as LightWalletGrpcService)
val available get() = synchronizer.saplingBalances.value?.available
@@ -164,6 +164,9 @@ class TestWallet(
}
}
+ // TODO [843]: Ktlint 0.48.1 (remove this suppress)
+ // TODO [843]: https://github.com/zcash/zcash-android-wallet-sdk/issues/843
+ @Suppress("ktlint:no-semi")
enum class Backups(val seedPhrase: String, val testnetBirthday: BlockHeight, val mainnetBirthday: BlockHeight) {
// TODO: get the proper birthday values for these wallets
DEFAULT(
@@ -205,7 +208,6 @@ class TestWallet(
1_330_190
),
BlockHeight.new(ZcashNetwork.Mainnet, 1_000_000)
- )
- ;
+ );
}
}
diff --git a/gradle.properties b/gradle.properties
index 36ea648b..9da11bd5 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -81,7 +81,7 @@ EMULATOR_WTF_GRADLE_PLUGIN_VERSION=0.0.12
FLANK_VERSION=22.10.0
FULLADLE_VERSION=0.17.4
GRADLE_VERSIONS_PLUGIN_VERSION=0.44.0
-KTLINT_VERSION=0.47.1
+KTLINT_VERSION=0.48.0
KSP_VERSION=1.7.21-1.0.8
PROTOBUF_GRADLE_PLUGIN_VERSION=0.8.19
RUST_GRADLE_PLUGIN_VERSION=0.9.3
diff --git a/sdk-lib/src/androidTest/java/cash/z/ecc/android/sdk/util/TestWallet.kt b/sdk-lib/src/androidTest/java/cash/z/ecc/android/sdk/util/TestWallet.kt
index 42b6cf41..44933b64 100644
--- a/sdk-lib/src/androidTest/java/cash/z/ecc/android/sdk/util/TestWallet.kt
+++ b/sdk-lib/src/androidTest/java/cash/z/ecc/android/sdk/util/TestWallet.kt
@@ -166,6 +166,9 @@ class TestWallet(
}
}
+ // TODO [843]: Ktlint 0.48.1 (remove this suppress)
+ // TODO [843]: https://github.com/zcash/zcash-android-wallet-sdk/issues/843
+ @Suppress("ktlint:no-semi")
enum class Backups(val seedPhrase: String, val testnetBirthday: BlockHeight, val mainnetBirthday: BlockHeight) {
// TODO: get the proper birthday values for these wallets
DEFAULT(
@@ -207,7 +210,6 @@ class TestWallet(
1_330_190
),
BlockHeight.new(ZcashNetwork.Mainnet, 1_000_000)
- )
- ;
+ );
}
}
diff --git a/sdk-lib/src/main/java/cash/z/ecc/android/sdk/block/CompactBlockProcessor.kt b/sdk-lib/src/main/java/cash/z/ecc/android/sdk/block/CompactBlockProcessor.kt
index 218ec140..de4e2e2c 100644
--- a/sdk-lib/src/main/java/cash/z/ecc/android/sdk/block/CompactBlockProcessor.kt
+++ b/sdk-lib/src/main/java/cash/z/ecc/android/sdk/block/CompactBlockProcessor.kt
@@ -227,13 +227,13 @@ class CompactBlockProcessor internal constructor(
val napTime = calculatePollInterval()
twig(
"$summary${
- if (result == BlockProcessingResult.FailedEnhance) {
- " (but there were" +
- " enhancement errors! We ignore those, for now. Memos in this block range are" +
- " probably missing! This will be improved in a future release.)"
- } else {
- ""
- }
+ if (result == BlockProcessingResult.FailedEnhance) {
+ " (but there were" +
+ " enhancement errors! We ignore those, for now. Memos in this block range are" +
+ " probably missing! This will be improved in a future release.)"
+ } else {
+ ""
+ }
}! Sleeping" +
" for ${napTime}ms (latest height: ${currentInfo.networkBlockHeight})."
)
@@ -932,7 +932,7 @@ class CompactBlockProcessor internal constructor(
?: repository.findBlockHash(height)
twig(
"block: $height\thash=${hash?.toHexReversed()} \tprevHash=${
- block?.prevHash?.toByteArray()?.toHexReversed()
+ block?.prevHash?.toByteArray()?.toHexReversed()
}"
)
}
diff --git a/sdk-lib/src/main/java/cash/z/ecc/android/sdk/exception/Exceptions.kt b/sdk-lib/src/main/java/cash/z/ecc/android/sdk/exception/Exceptions.kt
index e39fa3a3..45b92c85 100644
--- a/sdk-lib/src/main/java/cash/z/ecc/android/sdk/exception/Exceptions.kt
+++ b/sdk-lib/src/main/java/cash/z/ecc/android/sdk/exception/Exceptions.kt
@@ -157,11 +157,11 @@ sealed class BirthdayException(message: String, cause: Throwable? = null) : SdkE
nearestMatch: Checkpoint? = null
) : BirthdayException(
"Unable to find birthday that exactly matches $birthday.${
- if (nearestMatch != null) {
- " An exact match was request but the nearest match found was ${nearestMatch.height}."
- } else {
- ""
- }
+ if (nearestMatch != null) {
+ " An exact match was request but the nearest match found was ${nearestMatch.height}."
+ } else {
+ ""
+ }
}"
)
class BirthdayFileNotFoundException(directory: String, height: BlockHeight?) : BirthdayException(
diff --git a/sdk-lib/src/main/java/cash/z/ecc/android/sdk/ext/ConsensusBranchId.kt b/sdk-lib/src/main/java/cash/z/ecc/android/sdk/ext/ConsensusBranchId.kt
index 7b51263b..45908752 100644
--- a/sdk-lib/src/main/java/cash/z/ecc/android/sdk/ext/ConsensusBranchId.kt
+++ b/sdk-lib/src/main/java/cash/z/ecc/android/sdk/ext/ConsensusBranchId.kt
@@ -7,7 +7,9 @@ import java.util.Locale
* omitted since this is not the source of truth for branch information but rather a tool for
* printing that information to users.
*/
-@Suppress("MagicNumber")
+// TODO [843]: Ktlint 0.48.1 (remove this suppress)
+// TODO [843]: https://github.com/zcash/zcash-android-wallet-sdk/issues/843
+@Suppress("MagicNumber", "ktlint:no-semi")
enum class ConsensusBranchId(val displayName: String, val id: Long, val hexId: String) {
// TODO [#679]: see if we can find a way to not rely on this separate source of truth (either stop converting from
// hex to display name in the apps or use Rust to get this info)
diff --git a/.editorconfig b/tools/.editorconfig
similarity index 84%
rename from .editorconfig
rename to tools/.editorconfig
index 70736b16..18b02a66 100644
--- a/.editorconfig
+++ b/tools/.editorconfig
@@ -11,4 +11,10 @@ disabled_rules=import-ordering,no-wildcard-imports
# Examples (we use ij_kotlin_imports_layout to set an imports layout for both ktlint and IDEA via a single property):
ij_kotlin_imports_layout=* # alphabetical with capital letters before lower case letters (e.g. Z before a), no blank lines
ij_kotlin_imports_layout=*,java.**,javax.**,kotlin.**,^ # default IntelliJ IDEA style, same as alphabetical, but with "java", "javax", "kotlin" and alias imports in the end of the imports list
-ij_kotlin_imports_layout=android.**,|,^org.junit.**,kotlin.io.Closeable.*,|,*,^ # custom imports layout
\ No newline at end of file
+ij_kotlin_imports_layout=android.**,|,^org.junit.**,kotlin.io.Closeable.*,|,*,^ # custom imports layout
+
+# Opt-out from missing-trailing-comma rule enabled by default
+root = true
+[*.{kt,kts}]
+ktlint_standard_trailing-comma-on-call-site = disabled
+ktlint_standard_trailing-comma-on-declaration-site = disabled
\ No newline at end of file