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: comments:
active: false active: false
...@@ -39,6 +39,8 @@ complexity: ...@@ -39,6 +39,8 @@ complexity:
NestedBlockDepth: NestedBlockDepth:
active: true active: true
threshold: 4 threshold: 4
ReplaceSafeCallChainWithRun:
active: true
StringLiteralDuplication: StringLiteralDuplication:
active: true active: true
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
...@@ -64,6 +66,8 @@ coroutines: ...@@ -64,6 +66,8 @@ coroutines:
active: false active: false
RedundantSuspendModifier: RedundantSuspendModifier:
active: true active: true
SuspendFunWithFlowReturnType:
active: true
empty-blocks: empty-blocks:
active: true active: true
...@@ -130,6 +134,7 @@ exceptions: ...@@ -130,6 +134,7 @@ exceptions:
active: true active: true
ThrowingExceptionsWithoutMessageOrCause: ThrowingExceptionsWithoutMessageOrCause:
active: true active: true
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
exceptions: exceptions:
- IllegalArgumentException - IllegalArgumentException
- IllegalStateException - IllegalStateException
...@@ -152,6 +157,11 @@ formatting: ...@@ -152,6 +157,11 @@ formatting:
autoCorrect: true autoCorrect: true
AnnotationOnSeparateLine: AnnotationOnSeparateLine:
active: false active: false
AnnotationSpacing:
active: true
autoCorrect: true
ArgumentListWrapping:
active: false
ChainWrapping: ChainWrapping:
active: true active: true
autoCorrect: true autoCorrect: true
...@@ -302,6 +312,9 @@ naming: ...@@ -302,6 +312,9 @@ naming:
mustBeFirst: true mustBeFirst: true
MemberNameEqualsClassName: MemberNameEqualsClassName:
active: false active: false
NonBooleanPropertyPrefixedWithIs:
active: true
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
ObjectPropertyNaming: ObjectPropertyNaming:
active: true active: true
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
...@@ -378,6 +391,8 @@ potential-bugs: ...@@ -378,6 +391,8 @@ potential-bugs:
active: true active: true
MissingWhenCase: MissingWhenCase:
active: false active: false
NullableToStringCall:
active: true
RedundantElseInWhen: RedundantElseInWhen:
active: true active: true
UnconditionalJumpStatementInLoop: UnconditionalJumpStatementInLoop:
...@@ -399,6 +414,8 @@ potential-bugs: ...@@ -399,6 +414,8 @@ potential-bugs:
style: style:
active: true active: true
ClassOrdering:
active: false
CollapsibleIfStatements: CollapsibleIfStatements:
active: true active: true
DataClassContainsFunctions: DataClassContainsFunctions:
...@@ -441,6 +458,8 @@ style: ...@@ -441,6 +458,8 @@ style:
excludeAnnotatedFunction: ['dagger.Provides'] excludeAnnotatedFunction: ['dagger.Provides']
LibraryCodeMustSpecifyReturnType: LibraryCodeMustSpecifyReturnType:
active: true active: true
LibraryEntitiesShouldNotBePublic:
active: true
LoopWithTooManyJumpStatements: LoopWithTooManyJumpStatements:
active: true active: true
maxJumpCount: 1 maxJumpCount: 1
...@@ -518,14 +537,20 @@ style: ...@@ -518,14 +537,20 @@ style:
allowedNames: '(_|ignored|expected|serialVersionUID)' allowedNames: '(_|ignored|expected|serialVersionUID)'
UseArrayLiteralsInAnnotations: UseArrayLiteralsInAnnotations:
active: true active: true
UseCheckNotNull:
active: true
UseCheckOrError: UseCheckOrError:
active: true active: true
UseDataClass: UseDataClass:
active: false active: false
UseEmptyCounterpart:
active: true
UseIfInsteadOfWhen: UseIfInsteadOfWhen:
active: false active: false
UseRequire: UseRequire:
active: true active: true
UseRequireNotNull:
active: true
UselessCallOnNotNull: UselessCallOnNotNull:
active: true active: true
UtilityClassWithPublicConstructor: UtilityClassWithPublicConstructor:
......
...@@ -33,7 +33,8 @@ import android.view.LayoutInflater ...@@ -33,7 +33,8 @@ import android.view.LayoutInflater
import android.view.MenuItem import android.view.MenuItem
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.widget.* import android.widget.ImageView
import android.widget.TextView
import androidx.activity.result.ActivityResultLauncher import androidx.activity.result.ActivityResultLauncher
import androidx.appcompat.widget.PopupMenu import androidx.appcompat.widget.PopupMenu
import androidx.appcompat.widget.Toolbar import androidx.appcompat.widget.Toolbar
...@@ -41,7 +42,6 @@ import androidx.appcompat.widget.TooltipCompat ...@@ -41,7 +42,6 @@ import androidx.appcompat.widget.TooltipCompat
import androidx.core.os.bundleOf import androidx.core.os.bundleOf
import androidx.core.view.ViewCompat import androidx.core.view.ViewCompat
import androidx.fragment.app.DialogFragment import androidx.fragment.app.DialogFragment
import androidx.lifecycle.lifecycleScope
import androidx.recyclerview.widget.* import androidx.recyclerview.widget.*
import com.github.shadowsocks.aidl.TrafficStats import com.github.shadowsocks.aidl.TrafficStats
import com.github.shadowsocks.bg.BaseService import com.github.shadowsocks.bg.BaseService
...@@ -61,8 +61,6 @@ import com.google.zxing.BarcodeFormat ...@@ -61,8 +61,6 @@ import com.google.zxing.BarcodeFormat
import com.google.zxing.EncodeHintType import com.google.zxing.EncodeHintType
import com.google.zxing.MultiFormatWriter import com.google.zxing.MultiFormatWriter
import com.google.zxing.WriterException import com.google.zxing.WriterException
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import timber.log.Timber import timber.log.Timber
import java.nio.charset.StandardCharsets 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