Commit 7fd7684b authored by Mygod's avatar Mygod

Refine code style

parent abbfe4a0
# https://github.com/arturbosch/detekt/blob/v1.10.0/detekt-core/src/main/resources/default-detekt-config.yml
# https://github.com/detekt/detekt/blob/v1.14.2/detekt-core/src/main/resources/default-detekt-config.yml
comments:
active: false
......@@ -39,6 +39,8 @@ complexity:
NestedBlockDepth:
active: true
threshold: 4
ReplaceSafeCallChainWithRun:
active: true
StringLiteralDuplication:
active: true
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
......@@ -64,6 +66,8 @@ coroutines:
active: false
RedundantSuspendModifier:
active: true
SuspendFunWithFlowReturnType:
active: true
empty-blocks:
active: true
......@@ -130,6 +134,7 @@ exceptions:
active: true
ThrowingExceptionsWithoutMessageOrCause:
active: true
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
exceptions:
- IllegalArgumentException
- IllegalStateException
......@@ -152,6 +157,11 @@ formatting:
autoCorrect: true
AnnotationOnSeparateLine:
active: false
AnnotationSpacing:
active: true
autoCorrect: true
ArgumentListWrapping:
active: false
ChainWrapping:
active: true
autoCorrect: true
......@@ -302,6 +312,9 @@ naming:
mustBeFirst: true
MemberNameEqualsClassName:
active: false
NonBooleanPropertyPrefixedWithIs:
active: true
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
ObjectPropertyNaming:
active: true
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
......@@ -378,6 +391,8 @@ potential-bugs:
active: true
MissingWhenCase:
active: false
NullableToStringCall:
active: true
RedundantElseInWhen:
active: true
UnconditionalJumpStatementInLoop:
......@@ -399,6 +414,8 @@ potential-bugs:
style:
active: true
ClassOrdering:
active: false
CollapsibleIfStatements:
active: true
DataClassContainsFunctions:
......@@ -441,6 +458,8 @@ style:
excludeAnnotatedFunction: ['dagger.Provides']
LibraryCodeMustSpecifyReturnType:
active: true
LibraryEntitiesShouldNotBePublic:
active: true
LoopWithTooManyJumpStatements:
active: true
maxJumpCount: 1
......@@ -518,14 +537,20 @@ style:
allowedNames: '(_|ignored|expected|serialVersionUID)'
UseArrayLiteralsInAnnotations:
active: true
UseCheckNotNull:
active: true
UseCheckOrError:
active: true
UseDataClass:
active: false
UseEmptyCounterpart:
active: true
UseIfInsteadOfWhen:
active: false
UseRequire:
active: true
UseRequireNotNull:
active: true
UselessCallOnNotNull:
active: true
UtilityClassWithPublicConstructor:
......
......@@ -33,7 +33,8 @@ import android.view.LayoutInflater
import android.view.MenuItem
import android.view.View
import android.view.ViewGroup
import android.widget.*
import android.widget.ImageView
import android.widget.TextView
import androidx.activity.result.ActivityResultLauncher
import androidx.appcompat.widget.PopupMenu
import androidx.appcompat.widget.Toolbar
......@@ -41,7 +42,6 @@ import androidx.appcompat.widget.TooltipCompat
import androidx.core.os.bundleOf
import androidx.core.view.ViewCompat
import androidx.fragment.app.DialogFragment
import androidx.lifecycle.lifecycleScope
import androidx.recyclerview.widget.*
import com.github.shadowsocks.aidl.TrafficStats
import com.github.shadowsocks.bg.BaseService
......@@ -61,8 +61,6 @@ import com.google.zxing.BarcodeFormat
import com.google.zxing.EncodeHintType
import com.google.zxing.MultiFormatWriter
import com.google.zxing.WriterException
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import timber.log.Timber
import java.nio.charset.StandardCharsets
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment