Skip to content

Commit

Permalink
Fixed linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jusexton committed Nov 28, 2020
1 parent 62b7626 commit 155a787
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
16 changes: 8 additions & 8 deletions valiktor-core/src/main/kotlin/org/valiktor/Validator.kt
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,9 @@ open class Validator<E>(private val obj: E) {
val value = value()
if (!isValid(value)) {
this@Validator.constraintViolations += DefaultConstraintViolation(
property = name(),
value = value,
constraint = constraint(value)
property = name(),
value = value,
constraint = constraint(value)
)
}
return this
Expand All @@ -167,7 +167,7 @@ open class Validator<E>(private val obj: E) {
* @return the property validator
*/
fun validate(constraint: Constraint, isValid: (T?) -> Boolean): ValueValidator<T> =
validate({ constraint }, isValid)
validate({ constraint }, isValid)

/**
* Validates the property by passing the constraint and the suspending validation function
Expand All @@ -182,9 +182,9 @@ open class Validator<E>(private val obj: E) {
val value = value()
if (!isValid(value)) {
this@Validator.constraintViolations += DefaultConstraintViolation(
property = name(),
value = value,
constraint = constraint(value)
property = name(),
value = value,
constraint = constraint(value)
)
}
return this
Expand All @@ -200,7 +200,7 @@ open class Validator<E>(private val obj: E) {
* @return the property validator
*/
suspend fun coValidate(constraint: Constraint, isValid: suspend (T?) -> Boolean): ValueValidator<T> =
coValidate({ constraint }, isValid)
coValidate({ constraint }, isValid)

/**
* Adds the constraint violations to property
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,11 +282,11 @@ class BooleanFunctionsTest {
}

assertThat(exception.constraintViolations).containsExactly(
DefaultConstraintViolation(
property = "hasActiveStatus",
value = false,
constraint = True
)
DefaultConstraintViolation(
property = "hasActiveStatus",
value = false,
constraint = True
)
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class StringFunctionsTest {
}

assertThat(exception.constraintViolations).containsExactly(
DefaultConstraintViolation(property = "contact", value = "null null null", constraint = Null)
DefaultConstraintViolation(property = "contact", value = "null null null", constraint = Null)
)
}

Expand Down

0 comments on commit 155a787

Please sign in to comment.