diff --git a/build.gradle b/build.gradle index 9913e7c..736a90e 100644 --- a/build.gradle +++ b/build.gradle @@ -4,16 +4,16 @@ buildscript { compileSdk : 29, targetSdk : 29, kotlin : '1.3.61', - androidGradlePlugin: '4.0.0-alpha07', - versionsPlugin : '0.25.0', + androidGradlePlugin: '4.0.0-alpha08', + versionsPlugin : '0.27.0', hyperion : '0.9.27', debugDb : '1.0.6', chucker : '3.0.1', hyperionAppInfo : '1.1.0', deviceNames : '1.1.9', autoService : '1.0-rc6', - shipkit : '2f776772b70049ab287385aacd7a4313140ec254', - detekt : '1.3.1', + shipkit : '2.3.0', + detekt : '1.4.0', androidxAnnotations: '1.1.0' ] @@ -29,8 +29,7 @@ buildscript { classpath "com.android.tools.build:gradle:$versions.androidGradlePlugin" classpath "com.github.ben-manes:gradle-versions-plugin:$versions.versionsPlugin" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$versions.kotlin" - classpath "com.github.koral--:shipkit:$versions.shipkit" - //TODO replace with parent shipkit project once Android support is ready + classpath "org.shipkit:shipkit:$versions.shipkit" } } diff --git a/detekt-config.yml b/detekt-config.yml index dc3bcce..94448a1 100644 --- a/detekt-config.yml +++ b/detekt-config.yml @@ -1,11 +1,17 @@ build: maxIssues: 10 + excludeCorrectable: false weights: # complexity: 2 # LongParameterList: 1 # style: 1 # comments: 1 +config: + validation: true + # when writing own rules with new properties, exclude the property path e.g.: "my_rule_set,.*>.*>[my_property]" + excludes: "" + processors: active: true exclude: @@ -44,6 +50,8 @@ comments: searchInInnerInterface: true UndocumentedPublicFunction: active: false + UndocumentedPublicProperty: + active: false complexity: active: true @@ -56,9 +64,11 @@ complexity: includeStaticDeclarations: false ComplexMethod: active: true - threshold: 10 + threshold: 15 ignoreSingleWhenExpression: false ignoreSimpleWhenEntries: false + ignoreNestingFunctions: false + nestingFunctions: run,let,apply,with,also,use,forEach,isNotNull,ifNull LabeledExpression: active: false ignoredLabels: "" @@ -97,6 +107,13 @@ complexity: ignorePrivate: false ignoreOverridden: false +coroutines: + active: true + GlobalCoroutineUsage: + active: true + RedundantSuspendModifier: + active: true + empty-blocks: active: true EmptyCatchBlock: @@ -116,7 +133,7 @@ empty-blocks: active: true EmptyFunctionBlock: active: true - ignoreOverriddenFunctions: false + ignoreOverridden: false EmptyIfBlock: active: true EmptyInitBlock: @@ -194,6 +211,9 @@ formatting: CommentSpacing: active: true autoCorrect: true + EnumEntryNameCase: + active: true + autoCorrect: true Filename: active: true FinalNewline: @@ -225,6 +245,9 @@ formatting: NoEmptyClassBody: active: true autoCorrect: true + NoEmptyFirstLineInMethodBlock: + active: true + autoCorrect: true NoLineBreakAfterElse: active: true autoCorrect: true @@ -295,6 +318,7 @@ naming: parameterPattern: '[a-z][A-Za-z0-9]*' privateParameterPattern: '[a-z][A-Za-z0-9]*' excludeClassPattern: '$^' + ignoreOverridden: true EnumNaming: active: true excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" @@ -322,15 +346,15 @@ naming: excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" parameterPattern: '[a-z][A-Za-z0-9]*' excludeClassPattern: '$^' - ignoreOverriddenFunctions: true + ignoreOverridden: true InvalidPackageDeclaration: active: false rootPackage: '' MatchingDeclarationName: active: true MemberNameEqualsClassName: - active: false - ignoreOverriddenFunction: true + active: true + ignoreOverridden: true ObjectPropertyNaming: active: true excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" @@ -366,7 +390,7 @@ naming: performance: active: true ArrayPrimitive: - active: false + active: true ForEachOnRange: active: true excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" @@ -383,40 +407,44 @@ potential-bugs: DuplicateCaseInWhenExpression: active: true EqualsAlwaysReturnsTrueOrFalse: - active: false + active: true EqualsWithHashCodeExist: active: true ExplicitGarbageCollectionCall: active: true HasPlatformType: active: false + ImplicitDefaultLocale: + active: true InvalidRange: - active: false + active: true IteratorHasNextCallsNextMethod: - active: false + active: true IteratorNotThrowingNoSuchElementException: - active: false + active: true LateinitUsage: active: false excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" excludeAnnotatedProperties: "" ignoreOnClassesPattern: "" + MapGetWithNotNullAssertionOperator: + active: true MissingWhenCase: - active: false + active: true RedundantElseInWhen: - active: false + active: true UnconditionalJumpStatementInLoop: active: false UnreachableCode: active: true UnsafeCallOnNullableType: - active: false + active: true UnsafeCast: active: false UselessPostfixExpression: active: false WrongEqualsTypeParameter: - active: false + active: true style: active: true @@ -428,7 +456,7 @@ style: DataClassShouldBeImmutable: active: false EqualsNullCall: - active: false + active: true EqualsOnSignatureLine: active: false ExplicitItLambdaParameter: @@ -444,19 +472,25 @@ style: active: false imports: '' forbiddenPatterns: "" + ForbiddenMethodCall: + active: false + methods: '' + ForbiddenPublicDataClass: + active: true + ignorePackages: '*.internal,*.internal.*' ForbiddenVoid: active: false ignoreOverridden: false ignoreUsageInGenerics: false FunctionOnlyReturningConstant: - active: false + active: true ignoreOverridableFunction: true excludedFunctions: 'describeContents' excludeAnnotatedFunction: "dagger.Provides" LibraryCodeMustSpecifyReturnType: - active: false + active: true LoopWithTooManyJumpStatements: - active: false + active: true maxJumpCount: 1 MagicNumber: active: true @@ -464,6 +498,7 @@ style: ignoreNumbers: '-1,0,1,2' ignoreHashCodeFunction: true ignorePropertyDeclaration: false + ignoreLocalVariableDeclaration: false ignoreConstantDeclaration: true ignoreCompanionObjectPropertyDeclaration: true ignoreAnnotation: false @@ -479,7 +514,7 @@ style: excludeImportStatements: true excludeCommentStatements: false MayBeConst: - active: false + active: true ModifierOrder: active: true NestedClassesVisibility: @@ -497,7 +532,7 @@ style: PreferToOverPairSyntax: active: false ProtectedMemberInFinalClass: - active: false + active: true RedundantExplicitType: active: false RedundantVisibilityModifierRule: @@ -524,12 +559,14 @@ style: active: false acceptableDecimalLength: 5 UnnecessaryAbstractClass: - active: false + active: true excludeAnnotatedClasses: "dagger.Module" + UnnecessaryAnnotationUseSiteTarget: + active: true UnnecessaryApply: active: false UnnecessaryInheritance: - active: false + active: true UnnecessaryLet: active: false UnnecessaryParentheses: @@ -539,7 +576,7 @@ style: UnusedImports: active: false UnusedPrivateClass: - active: false + active: true UnusedPrivateMember: active: false allowedNames: "(_|ignored|expected|serialVersionUID)" @@ -556,9 +593,9 @@ style: UseRequire: active: false UselessCallOnNotNull: - active: false + active: true UtilityClassWithPublicConstructor: - active: false + active: true VarCouldBeVal: active: false WildcardImport: diff --git a/gradle.properties b/gradle.properties index 1de82b4..28c92e4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,7 +5,7 @@ android.useAndroidX=true android.enableJetifier=true kotlin.code.style=official android.defaults.buildfeatures.buildconfig=false -android.defaults.buildfeatures.aidl=true -android.defaults.buildfeatures.renderscript=true +android.defaults.buildfeatures.aidl=false +android.defaults.buildfeatures.renderscript=false android.defaults.buildfeatures.resvalues=false android.defaults.buildfeatures.shaders=false \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 0d5f05a..ba94df8 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.1-rc-1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists