Update Kotlinter to 3.15.0

This commit is contained in:
Niko Diamadis
2023-07-18 00:01:04 +02:00
parent 757dedcfa2
commit 2397e2eea9
13 changed files with 25 additions and 20 deletions

View File

@@ -1,7 +1,7 @@
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'org.jmailen.kotlinter' version '3.13.0'
id 'org.jmailen.kotlinter' version '3.15.0'
}
android {

View File

@@ -17,12 +17,6 @@ import com.google.android.material.snackbar.Snackbar
import com.google.gson.Gson
import com.squareup.picasso.Picasso.LoadedFrom
import com.squareup.picasso.Target
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import okio.Buffer
import org.threeten.bp.OffsetDateTime
import java.io.BufferedReader
import java.io.IOException
import java.io.InputStream
@@ -31,6 +25,12 @@ import java.net.MalformedURLException
import java.net.URI
import java.net.URISyntaxException
import java.net.URL
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import okio.Buffer
import org.threeten.bp.OffsetDateTime
internal object Utils {
val JSON: Gson = JSON().gson

View File

@@ -1,7 +1,7 @@
package com.github.gotify.api
import retrofit2.Call
import java.io.IOException
import retrofit2.Call
internal object Api {
@Throws(ApiException::class)

View File

@@ -1,7 +1,7 @@
package com.github.gotify.api
import retrofit2.Response
import java.io.IOException
import retrofit2.Response
internal class ApiException : Exception {
var body: String = ""

View File

@@ -51,7 +51,10 @@ internal class Callback<T> private constructor(
)
}
fun <T> call(onSuccess: SuccessCallback<T> = SuccessCallback {}, onError: ErrorCallback = ErrorCallback {}): retrofit2.Callback<T> {
fun <T> call(
onSuccess: SuccessCallback<T> = SuccessCallback {},
onError: ErrorCallback = ErrorCallback {}
): retrofit2.Callback<T> {
return RetrofitCallback(merge(of(onSuccess, onError), errorCallback()))
}

View File

@@ -4,7 +4,6 @@ import android.annotation.SuppressLint
import com.github.gotify.SSLSettings
import com.github.gotify.Utils
import com.github.gotify.log.Log
import okhttp3.OkHttpClient
import java.io.IOException
import java.security.GeneralSecurityException
import java.security.KeyStore
@@ -16,6 +15,7 @@ import javax.net.ssl.SSLContext
import javax.net.ssl.TrustManager
import javax.net.ssl.TrustManagerFactory
import javax.net.ssl.X509TrustManager
import okhttp3.OkHttpClient
internal object CertUtils {
@SuppressLint("CustomX509TrustManager")

View File

@@ -31,8 +31,8 @@ import com.github.gotify.log.LogsActivity
import com.github.gotify.log.UncaughtExceptionHandler
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import com.google.android.material.textfield.TextInputEditText
import okhttp3.HttpUrl
import java.security.cert.X509Certificate
import okhttp3.HttpUrl
internal class LoginActivity : AppCompatActivity() {
companion object {

View File

@@ -26,9 +26,9 @@ import com.github.gotify.databinding.MessageItemCompactBinding
import com.github.gotify.messages.provider.MessageWithImage
import com.squareup.picasso.Picasso
import io.noties.markwon.Markwon
import org.threeten.bp.OffsetDateTime
import java.text.DateFormat
import java.util.Date
import org.threeten.bp.OffsetDateTime
internal class ListMessageAdapter(
private val context: Context,

View File

@@ -56,9 +56,9 @@ import com.google.android.material.dialog.MaterialAlertDialogBuilder
import com.google.android.material.navigation.NavigationView
import com.google.android.material.snackbar.BaseTransientBottomBar.BaseCallback
import com.google.android.material.snackbar.Snackbar
import java.io.IOException
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import java.io.IOException
internal class MessagesActivity :
AppCompatActivity(),

View File

@@ -11,10 +11,10 @@ import com.github.gotify.client.model.Application
import com.github.gotify.log.Log
import com.squareup.picasso.OkHttp3Downloader
import com.squareup.picasso.Picasso
import okhttp3.Cache
import okhttp3.OkHttpClient
import java.io.File
import java.io.IOException
import okhttp3.Cache
import okhttp3.OkHttpClient
internal class PicassoHandler(private val context: Context, private val settings: Settings) {
companion object {

View File

@@ -10,15 +10,15 @@ import com.github.gotify.Utils
import com.github.gotify.api.CertUtils
import com.github.gotify.client.model.Message
import com.github.gotify.log.Log
import java.util.Calendar
import java.util.concurrent.TimeUnit
import java.util.concurrent.atomic.AtomicLong
import okhttp3.HttpUrl
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.Response
import okhttp3.WebSocket
import okhttp3.WebSocketListener
import java.util.Calendar
import java.util.concurrent.TimeUnit
import java.util.concurrent.atomic.AtomicLong
internal class WebSocketConnection(
private val baseUrl: String,

View File

@@ -141,7 +141,7 @@ internal class WebSocketService : Service() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
NotificationSupport.createChannels(
this,
(this.getSystemService(NOTIFICATION_SERVICE) as NotificationManager),
(getSystemService(NOTIFICATION_SERVICE) as NotificationManager),
apps
)
}