Skip to content

Commit

Permalink
chore: Mega Linters
Browse files Browse the repository at this point in the history
Signed-off-by: Ahmed Moussa <ahmed.moussa@iohk.io>
  • Loading branch information
hamada147 committed Mar 19, 2024
1 parent 22bb989 commit d034dce
Show file tree
Hide file tree
Showing 8 changed files with 77 additions and 26 deletions.
1 change: 1 addition & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ ktlint_code_style = intellij_idea
ktlint_standard_no_semi = disabled
ktlint_standard_trailing-comma-on-call-site = disabled
ktlint_standard_trailing-comma-on-declaration-site = disabled
ktlint_standard_no-empty-file = disabled
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ data class AttachmentDescriptor @JvmOverloads constructor(
val data: AttachmentData,
val filename: Array<String>? = null,
val format: String? = null,
val lastModTime: String? = null, // TODO(Date format)
// TODO(Date format)
val lastModTime: String? = null,
val byteCount: Int? = null,
val description: String? = null
) : AttachmentData {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import kotlinx.serialization.Serializable
* @property entropy The entropy for the credential request.
* @property nonce The nonce for the credential request.
*/
@Suppress("ktlint:standard:property-naming")
interface CredentialRequest {
val cred_def_id: String
val blinded_ms: CredentialRequestBlindedMS
Expand All @@ -38,6 +39,7 @@ interface CredentialRequestBlindedMS {
* @property v_dash_cap The value used in the proof calculation.
* @property m_caps The map of attribute names to their corresponding blinded value commitments.
*/
@Suppress("ktlint:standard:property-naming")
interface CredentialRequestBlindedMSCorrectnessProof {
val c: String
val v_dash_cap: String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,17 +118,31 @@ class ConnectionAccept {
* @return true if this [Body] object is equal to the specified [other] object, false otherwise.
*/
override fun equals(other: Any?): Boolean {
if (this === other) return true
if (other == null || this::class != other::class) return false
if (this === other) {
return true
}
if (other == null || this::class != other::class) {
return false
}

other as Body

if (goalCode != other.goalCode) return false
if (goal != other.goal) return false
if (goalCode != other.goalCode) {
return false
}
if (goal != other.goal) {
return false
}
if (accept != null) {
if (other.accept == null) return false
if (!accept.contentEquals(other.accept)) return false
} else if (other.accept != null) return false
if (other.accept == null) {
return false
}
if (!accept.contentEquals(other.accept)) {
return false
}
} else if (other.accept != null) {
return false
}

return true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,17 +143,31 @@ class ConnectionRequest {
* @return true if the objects are equal, false otherwise.
*/
override fun equals(other: Any?): Boolean {
if (this === other) return true
if (other == null || this::class != other::class) return false
if (this === other) {
return true
}
if (other == null || this::class != other::class) {
return false
}

other as Body

if (goalCode != other.goalCode) return false
if (goal != other.goal) return false
if (goalCode != other.goalCode) {
return false
}
if (goal != other.goal) {
return false
}
if (accept != null) {
if (other.accept == null) return false
if (!accept.contentEquals(other.accept)) return false
} else if (other.accept != null) return false
if (other.accept == null) {
return false
}
if (!accept.contentEquals(other.accept)) {
return false
}
} else if (other.accept != null) {
return false
}

return true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,38 @@ data class ProofTypes(
* @return true if the objects are equal, false otherwise.
*/
override fun equals(other: Any?): Boolean {
if (this === other) return true
if (other == null || this::class != other::class) return false
if (this === other) {
return true
}
if (other == null || this::class != other::class) {
return false
}

other as ProofTypes

if (schema != other.schema) return false
if (schema != other.schema) {
return false
}
if (requiredFields != null) {
if (other.requiredFields == null) return false
if (!requiredFields.contentEquals(other.requiredFields)) return false
} else if (other.requiredFields != null) return false
if (other.requiredFields == null) {
return false
}
if (!requiredFields.contentEquals(other.requiredFields)) {
return false
}
} else if (other.requiredFields != null) {
return false
}
if (trustIssuers != null) {
if (other.trustIssuers == null) return false
if (!trustIssuers.contentEquals(other.trustIssuers)) return false
} else if (other.trustIssuers != null) return false
if (other.trustIssuers == null) {
return false
}
if (!trustIssuers.contentEquals(other.trustIssuers)) {
return false
}
} else if (other.trustIssuers != null) {
return false
}

return true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ class MercuryTests {
fun testSendMessage_shouldThrowError_whenServiceAbsent() = runTest {
val idDid = DID("did", "prism", "123")
val allAuthentication = DIDDocument.Authentication(arrayOf(), arrayOf())
val resolveDIDReturn = DIDDocument(idDid, arrayOf(/*service,*/ allAuthentication))
// val resolveDIDReturn = DIDDocument(idDid, arrayOf(/*service,*/ allAuthentication))
val resolveDIDReturn = DIDDocument(idDid, arrayOf(allAuthentication))
castorMock.resolveDIDReturn = resolveDIDReturn
val msg = Message(piuri = "", body = "", from = DID("test", "method", "id"), to = DID("test", "method", "id"))
assertFailsWith<MercuryError.NoValidServiceFoundError> { sut.sendMessage(msg) }
Expand Down
2 changes: 1 addition & 1 deletion sampleapp/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
id("com.google.devtools.ksp") version("1.9.22-1.0.16")
id("com.google.devtools.ksp") version "1.9.22-1.0.16"
}

apply(plugin = "kotlinx-atomicfu")
Expand Down

0 comments on commit d034dce

Please sign in to comment.