Skip to content

Commit

Permalink
Fixed ktlint warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
twaddington committed Jan 10, 2020
1 parent 92360e9 commit 8af8354
Show file tree
Hide file tree
Showing 409 changed files with 1,467 additions and 1,497 deletions.
3 changes: 1 addition & 2 deletions .editorconfig
@@ -1,4 +1,3 @@
[*.kt]
# possible values: number (e.g. 2), "unset" (makes ktlint ignore indentation completely)
indent_size=2
disabled_rules=no-unit-return,import-ordering
disabled_rules=no-wildcard-imports,import-ordering
Expand Up @@ -27,5 +27,5 @@ data class AccountAuthenticationAdobePostActivationCredentials(
* @return The device token
*/

val userID: AdobeUserID)

val userID: AdobeUserID
)
Expand Up @@ -39,4 +39,5 @@ data class AccountAuthenticationAdobePreActivationCredentials(
* The post activation credentials that resulted from device activation, iff any device activation has been performed
*/

val postActivationCredentials: AccountAuthenticationAdobePostActivationCredentials?)
val postActivationCredentials: AccountAuthenticationAdobePostActivationCredentials?
)
Expand Up @@ -18,18 +18,20 @@ interface AccountAuthenticationCredentialsStoreType {

fun put(
account: AccountID,
credentials: AccountAuthenticationCredentials)
credentials: AccountAuthenticationCredentials
)

/**
* Delete the credentials for the given account, if any.
*/

fun delete(
account: AccountID)
account: AccountID
)

/**
* The number of entries in the store
*/

fun size(): Int
}
}
Expand Up @@ -18,8 +18,8 @@ sealed class AccountCreateErrorDetails : PresentableErrorType {
*/

data class AccountProviderResolutionFailed(
val errorValues: List<AccountProviderResolutionErrorDetails>)
: AccountCreateErrorDetails() {
val errorValues: List<AccountProviderResolutionErrorDetails>
) : AccountCreateErrorDetails() {

init {
Preconditions.checkArgument(
Expand All @@ -41,8 +41,8 @@ sealed class AccountCreateErrorDetails : PresentableErrorType {

data class UnexpectedException(
override val message: String,
override val exception: Throwable)
: AccountCreateErrorDetails()
override val exception: Throwable
) : AccountCreateErrorDetails()

/**
* An HTTP request could not be made.
Expand All @@ -52,8 +52,8 @@ sealed class AccountCreateErrorDetails : PresentableErrorType {
override val message: String,
val opdsURI: URI,
val status: Int,
override val problemReport: HTTPProblemReport?)
: AccountCreateErrorDetails(), HTTPHasProblemReportType {
override val problemReport: HTTPProblemReport?
) : AccountCreateErrorDetails(), HTTPHasProblemReportType {

override val attributes: Map<String, String>
get() = Presentables.mergeProblemReportOptional(super.attributes, this.problemReport)
Expand Down
Expand Up @@ -13,16 +13,15 @@ sealed class AccountDeleteErrorDetails : PresentableErrorType {
*/

data class AccountCannotDeleteLastAccount(
override val message: String)
: AccountDeleteErrorDetails()
override val message: String
) : AccountDeleteErrorDetails()

/**
* An unexpected exception occurred.
*/

data class AccountUnexpectedException(
override val message: String,
override val exception: Throwable)
: AccountDeleteErrorDetails()

override val exception: Throwable
) : AccountDeleteErrorDetails()
}
Expand Up @@ -16,29 +16,28 @@ sealed class AccountEventCreation : AccountEvent(), PresentableType {
*/

data class AccountEventCreationInProgress(
override val message: String)
: AccountEventCreation()
override val message: String
) : AccountEventCreation()

/**
* Creating an account succeeded.
*/

data class AccountEventCreationSucceeded(
override val message: String,
val id: AccountID)
: AccountEventCreation()
val id: AccountID
) : AccountEventCreation()

/**
* Creating an account failed.
*/

data class AccountEventCreationFailed(
override val message: String,
val taskResult: TaskResult.Failure<AccountCreateErrorDetails, *>)
: AccountEventCreation(), PresentableErrorType {
val taskResult: TaskResult.Failure<AccountCreateErrorDetails, *>
) : AccountEventCreation(), PresentableErrorType {

override val attributes: Map<String, String>
get() = Presentables.collectAttributes(this.taskResult.errors())
}

}
Expand Up @@ -16,29 +16,28 @@ sealed class AccountEventDeletion : AccountEvent(), PresentableType {
*/

data class AccountEventDeletionInProgress(
override val message: String)
: AccountEventDeletion()
override val message: String
) : AccountEventDeletion()

/**
* Deleting an account succeeded.
*/

data class AccountEventDeletionSucceeded(
override val message: String,
val id: AccountID)
: AccountEventDeletion()
val id: AccountID
) : AccountEventDeletion()

/**
* Deleting an account failed.
*/

data class AccountEventDeletionFailed(
override val message: String,
val taskResult: TaskResult.Failure<AccountDeleteErrorDetails, *>)
: AccountEventDeletion(), PresentableErrorType {
val taskResult: TaskResult.Failure<AccountDeleteErrorDetails, *>
) : AccountEventDeletion(), PresentableErrorType {

override val attributes: Map<String, String>
get() = Presentables.collectAttributes(this.causes)
}

}
Expand Up @@ -9,5 +9,5 @@ import org.nypl.simplified.presentableerror.api.PresentableType
data class AccountEventLoginStateChanged(
override val message: String,
val accountID: AccountID,
val state: AccountLoginState)
: AccountEvent(), PresentableType
val state: AccountLoginState
) : AccountEvent(), PresentableType
Expand Up @@ -6,5 +6,5 @@ package org.nypl.simplified.accounts.api

data class AccountEventUpdated(
override val message: String,
val accountID: AccountID)
: AccountEvent()
val accountID: AccountID
) : AccountEvent()
Expand Up @@ -8,7 +8,8 @@ import java.util.UUID
*/

data class AccountID(
val uuid: UUID) : Serializable, Comparable<AccountID> {
val uuid: UUID
) : Serializable, Comparable<AccountID> {

override fun compareTo(other: AccountID): Int =
this.uuid.compareTo(other.uuid)
Expand All @@ -24,6 +25,5 @@ data class AccountID(

fun generate(): AccountID =
AccountID(UUID.randomUUID())

}
}
}
Expand Up @@ -7,7 +7,6 @@ import org.nypl.simplified.parser.api.ParseWarning
import org.nypl.simplified.presentableerror.api.PresentableErrorType
import org.nypl.simplified.presentableerror.api.Presentables
import org.nypl.simplified.taskrecorder.api.TaskResult
import org.nypl.simplified.taskrecorder.api.TaskStep
import java.io.Serializable
import java.net.URI

Expand Down Expand Up @@ -43,7 +42,8 @@ sealed class AccountLoginState {
* @see AccountLoginStringResourcesType
*/

val status: String) : AccountLoginState() {
val status: String
) : AccountLoginState() {

override val credentials: AccountAuthenticationCredentials?
get() = null
Expand All @@ -60,7 +60,8 @@ sealed class AccountLoginState {
*/

data class AccountLoginCredentialsIncorrect(
override val message: String) : AccountLoginErrorData() {
override val message: String
) : AccountLoginErrorData() {
override fun toString(): String =
this.javaClass.simpleName
}
Expand All @@ -70,7 +71,8 @@ sealed class AccountLoginState {
*/

data class AccountLoginNotRequired(
override val message: String) : AccountLoginErrorData() {
override val message: String
) : AccountLoginErrorData() {
override fun toString(): String =
this.javaClass.simpleName
}
Expand All @@ -80,7 +82,8 @@ sealed class AccountLoginState {
*/

data class AccountLoginConnectionFailure(
override val message: String) : AccountLoginErrorData() {
override val message: String
) : AccountLoginErrorData() {
override fun toString(): String =
this.javaClass.simpleName
}
Expand All @@ -92,8 +95,8 @@ sealed class AccountLoginState {
data class AccountLoginServerParseError(
override val message: String,
val warnings: List<ParseWarning>,
val errors: List<ParseError>)
: AccountLoginErrorData() {
val errors: List<ParseError>
) : AccountLoginErrorData() {
override fun toString(): String =
this.javaClass.simpleName
}
Expand All @@ -107,8 +110,8 @@ sealed class AccountLoginState {
val uri: URI,
val statusCode: Int,
val errorMessage: String,
override val problemReport: HTTPProblemReport?)
: AccountLoginErrorData(), HTTPHasProblemReportType {
override val problemReport: HTTPProblemReport?
) : AccountLoginErrorData(), HTTPHasProblemReportType {

override val attributes: Map<String, String>
get() = Presentables.mergeProblemReportOptional(super.attributes, this.problemReport)
Expand All @@ -120,51 +123,51 @@ sealed class AccountLoginState {

data class AccountLoginDRMNotSupported(
override val message: String,
val system: String)
: AccountLoginErrorData()
val system: String
) : AccountLoginErrorData()

/**
* A DRM system failed with an (opaque) error code.
*/

data class AccountLoginDRMFailure(
override val message: String,
val errorCode: String)
: AccountLoginErrorData()
val errorCode: String
) : AccountLoginErrorData()

/**
* A DRM system failed due to having too many device activations.
*/

data class AccountLoginDRMTooManyActivations(
override val message: String)
: AccountLoginErrorData()
override val message: String
) : AccountLoginErrorData()

/**
* An unexpected exception occurred.
*/

data class AccountLoginUnexpectedException(
override val message: String,
override val exception: Throwable)
: AccountLoginErrorData()
override val exception: Throwable
) : AccountLoginErrorData()

/**
* Logging in failed due to some missing information.
*/

data class AccountLoginMissingInformation(
override val message: String)
: AccountLoginErrorData()
override val message: String
) : AccountLoginErrorData()
}

/**
* The account failed to log in.
*/

data class AccountLoginFailed(
val taskResult: TaskResult.Failure<AccountLoginErrorData, *>)
: AccountLoginState() {
val taskResult: TaskResult.Failure<AccountLoginErrorData, *>
) : AccountLoginState() {

override val credentials: AccountAuthenticationCredentials?
get() = null
Expand All @@ -175,8 +178,8 @@ sealed class AccountLoginState {
*/

data class AccountLoggedIn(
override val credentials: AccountAuthenticationCredentials)
: AccountLoginState()
override val credentials: AccountAuthenticationCredentials
) : AccountLoginState()

/**
* The account is currently logging out.
Expand All @@ -191,8 +194,8 @@ sealed class AccountLoginState {
* @see AccountLogoutStringResourcesType
*/

val status: String)
: AccountLoginState()
val status: String
) : AccountLoginState()

/**
* Data associated with failed logout attempts.
Expand All @@ -205,8 +208,8 @@ sealed class AccountLoginState {
*/

data class AccountLogoutDRMFailure(
val errorCode: String)
: AccountLogoutErrorData() {
val errorCode: String
) : AccountLogoutErrorData() {

override val message: String
get() = this.errorCode
Expand All @@ -217,8 +220,8 @@ sealed class AccountLoginState {
*/

data class AccountLogoutUnexpectedException(
override val exception: Throwable)
: AccountLogoutErrorData() {
override val exception: Throwable
) : AccountLogoutErrorData() {
override val message: String
get() = this.exception.localizedMessage
}
Expand All @@ -230,7 +233,6 @@ sealed class AccountLoginState {

data class AccountLogoutFailed(
val taskResult: TaskResult.Failure<AccountLogoutErrorData, *>,
override val credentials: AccountAuthenticationCredentials)
: AccountLoginState()

override val credentials: AccountAuthenticationCredentials
) : AccountLoginState()
}

0 comments on commit 8af8354

Please sign in to comment.