update ktlint plugin to 11.3.1, format code (#3442)

This commit is contained in:
Konrad Pozniak 2023-03-13 13:16:39 +01:00 committed by GitHub
commit d839f18267
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
141 changed files with 589 additions and 428 deletions

View file

@ -29,8 +29,9 @@ class FilterModel @Inject constructor() {
// Patterns are expensive and thread-safe, matchers are neither.
val matcher = pattern?.matcher("") ?: return Filter.Action.NONE
if (status.poll?.options?.any { matcher.reset(it.title).find() } == true)
if (status.poll?.options?.any { matcher.reset(it.title).find() } == true) {
return Filter.Action.HIDE
}
val spoilerText = status.actionableStatus.spoilerText
val attachmentsDescriptions = status.attachments.mapNotNull { it.description }

View file

@ -34,7 +34,6 @@ class InstanceSwitchAuthInterceptor(private val accountManager: AccountManager)
// only switch domains if the request comes from retrofit
return if (originalRequest.url.host == MastodonApi.PLACEHOLDER_DOMAIN) {
val builder: Request.Builder = originalRequest.newBuilder()
val instanceHeader = originalRequest.header(MastodonApi.DOMAIN_HEADER)

View file

@ -194,7 +194,7 @@ interface MastodonApi {
@Header("Authorization") auth: String,
@Header(DOMAIN_HEADER) domain: String,
@Header("Idempotency-Key") idempotencyKey: String,
@Body editedStatus: NewStatus,
@Body editedStatus: NewStatus
): NetworkResult<Status>
@GET("api/v1/statuses/{id}")
@ -298,7 +298,7 @@ interface MastodonApi {
@GET("api/v1/accounts/verify_credentials")
suspend fun accountVerifyCredentials(
@Header(DOMAIN_HEADER) domain: String? = null,
@Header("Authorization") auth: String? = null,
@Header("Authorization") auth: String? = null
): NetworkResult<Account>
@FormUrlEncoded
@ -306,7 +306,7 @@ interface MastodonApi {
fun accountUpdateSource(
@Field("source[privacy]") privacy: String?,
@Field("source[sensitive]") sensitive: Boolean?,
@Field("source[language]") language: String?,
@Field("source[language]") language: String?
): Call<Account>
@Multipart
@ -607,7 +607,7 @@ interface MastodonApi {
@Field("title") title: String,
@Field("context[]") context: List<String>,
@Field("filter_action") filterAction: String,
@Field("expires_in") expiresInSeconds: Int?,
@Field("expires_in") expiresInSeconds: Int?
): NetworkResult<Filter>
@FormUrlEncoded
@ -617,7 +617,7 @@ interface MastodonApi {
@Field("title") title: String? = null,
@Field("context[]") context: List<String>? = null,
@Field("filter_action") filterAction: String? = null,
@Field("expires_in") expiresInSeconds: Int? = null,
@Field("expires_in") expiresInSeconds: Int? = null
): NetworkResult<Filter>
@DELETE("api/v2/filters/{id}")
@ -630,7 +630,7 @@ interface MastodonApi {
suspend fun addFilterKeyword(
@Path("filterId") filterId: String,
@Field("keyword") keyword: String,
@Field("whole_word") wholeWord: Boolean,
@Field("whole_word") wholeWord: Boolean
): NetworkResult<FilterKeyword>
@FormUrlEncoded
@ -638,12 +638,12 @@ interface MastodonApi {
suspend fun updateFilterKeyword(
@Path("keywordId") keywordId: String,
@Field("keyword") keyword: String,
@Field("whole_word") wholeWord: Boolean,
@Field("whole_word") wholeWord: Boolean
): NetworkResult<FilterKeyword>
@DELETE("api/v2/filters/keywords/{keywordId}")
suspend fun deleteFilterKeyword(
@Path("keywordId") keywordId: String,
@Path("keywordId") keywordId: String
): NetworkResult<ResponseBody>
@FormUrlEncoded
@ -751,7 +751,7 @@ interface MastodonApi {
@DELETE("api/v1/push/subscription")
suspend fun unsubscribePushNotifications(
@Header("Authorization") auth: String,
@Header(DOMAIN_HEADER) domain: String,
@Header(DOMAIN_HEADER) domain: String
): NetworkResult<ResponseBody>
@GET("api/v1/tags/{name}")
@ -762,7 +762,7 @@ interface MastodonApi {
@Query("min_id") minId: String? = null,
@Query("since_id") sinceId: String? = null,
@Query("max_id") maxId: String? = null,
@Query("limit") limit: Int? = null,
@Query("limit") limit: Int? = null
): Response<List<HashTag>>
@POST("api/v1/tags/{name}/follow")