style: fix lint

This commit is contained in:
usbharu 2024-09-06 17:47:11 +09:00
parent ee23ce8b82
commit da106a6922
Signed by: usbharu
GPG Key ID: 6556747BF94EEBC8
8 changed files with 14 additions and 23 deletions

View File

@ -22,7 +22,5 @@ class MessageSourceConfig {
@Bean
@Profile("dev")
@ConfigurationProperties(prefix = "spring.messages")
fun messageSourceProperties(): MessageSourceProperties {
return MessageSourceProperties()
}
fun messageSourceProperties(): MessageSourceProperties = MessageSourceProperties()
}

View File

@ -140,6 +140,7 @@ class SecurityConfig {
}
@Bean
@Suppress("UnsafeCallOnNullableType")
fun loadJwkSource(jwkConfig: JwkConfig, applicationConfig: ApplicationConfig): JWKSource<SecurityContext> {
if (jwkConfig.keyId == null) {
logger.error("hideout.security.jwt.keyId is null.")

View File

@ -18,7 +18,5 @@ package dev.usbharu.hideout.core.domain.model.userdetails
@JvmInline
value class UserDetailHashedPassword(val password: String) {
override fun toString(): String {
return "[MASKED]"
}
override fun toString(): String = "[MASKED]"
}

View File

@ -18,7 +18,5 @@ package dev.usbharu.hideout.core.domain.model.userdetails
@JvmInline
value class UserDetailId(val id: Long) {
override fun toString(): String {
return "UserDetailId(id=$id)"
}
override fun toString(): String = "UserDetailId(id=$id)"
}

View File

@ -17,6 +17,9 @@ import java.net.URI
@Repository
class ExposedUserTimelineQueryService : UserTimelineQueryService, AbstractRepository() {
override val logger: Logger
get() = Companion.logger
protected fun authorizedQuery(principal: Principal? = null): QueryAlias {
if (principal == null) {
return Posts
@ -73,8 +76,8 @@ class ExposedUserTimelineQueryService : UserTimelineQueryService, AbstractReposi
private fun toPostDetail(it: ResultRow, authorizedQuery: QueryAlias, iconMedia: Alias<Media>): PostDetail {
return PostDetail(
it[authorizedQuery[Posts.id]],
ActorDetail(
id = it[authorizedQuery[Posts.id]],
actor = ActorDetail(
actorId = it[authorizedQuery[Posts.actorId]],
instanceId = it[Actors.instance],
name = it[Actors.name],
@ -101,9 +104,6 @@ class ExposedUserTimelineQueryService : UserTimelineQueryService, AbstractReposi
)
}
override val logger: Logger
get() = Companion.logger
companion object {
private val logger = LoggerFactory.getLogger(ExposedUserTimelineQueryService::class.java)
}

View File

@ -60,7 +60,6 @@ class AuthController(
}
@GetMapping("/auth/sign_out")
fun signOut(): String {
return "sign_out"
}
@Suppress("FunctionOnlyReturningConstant")
fun signOut(): String = "sign_out"
}

View File

@ -1,5 +1,6 @@
package dev.usbharu.hideout.core.interfaces.web.posts
@Suppress("ConstructorParameterNaming")
data class PublishPost(
var status: String? = null,
var overview: String? = null,

View File

@ -45,11 +45,7 @@ object RsaUtil {
fun decodeRsaPrivateKey(encoded: String): RSAPrivateKey = decodeRsaPrivateKey(Base64Util.decode(encoded))
fun encodeRsaPublicKey(publicKey: RSAPublicKey): String {
return Base64Util.encode(publicKey.encoded)
}
fun encodeRsaPublicKey(publicKey: RSAPublicKey): String = Base64Util.encode(publicKey.encoded)
fun encodeRsaPrivateKey(privateKey: RSAPrivateKey): String {
return Base64Util.encode(privateKey.encoded)
}
fun encodeRsaPrivateKey(privateKey: RSAPrivateKey): String = Base64Util.encode(privateKey.encoded)
}