From 420ff47b6489e945c5287759ed099a5a9549eb9a Mon Sep 17 00:00:00 2001 From: code-schreiber Date: Fri, 7 Jun 2019 15:47:35 +0200 Subject: [PATCH 1/8] Some changes --- app/src/main/java/com/toolslab/reviewme/MainActivity.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/toolslab/reviewme/MainActivity.kt b/app/src/main/java/com/toolslab/reviewme/MainActivity.kt index d1eceeb..48e038a 100644 --- a/app/src/main/java/com/toolslab/reviewme/MainActivity.kt +++ b/app/src/main/java/com/toolslab/reviewme/MainActivity.kt @@ -5,8 +5,11 @@ import android.os.Bundle class MainActivity : AppCompatActivity() { - override fun onCreate(savedInstanceState: Bundle?) { + override fun onCreate(savedInstanceState: Bundle?) + { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) } + } + From 135396cf69a7504a22c56ec27f3969d08200d1fd Mon Sep 17 00:00:00 2001 From: code-schreiber Date: Fri, 7 Jun 2019 16:00:23 +0200 Subject: [PATCH 2/8] Format code --- app/src/main/java/com/toolslab/reviewme/MainActivity.kt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/toolslab/reviewme/MainActivity.kt b/app/src/main/java/com/toolslab/reviewme/MainActivity.kt index 48e038a..e684bba 100644 --- a/app/src/main/java/com/toolslab/reviewme/MainActivity.kt +++ b/app/src/main/java/com/toolslab/reviewme/MainActivity.kt @@ -1,12 +1,11 @@ package com.toolslab.reviewme -import androidx.appcompat.app.AppCompatActivity import android.os.Bundle +import androidx.appcompat.app.AppCompatActivity class MainActivity : AppCompatActivity() { - override fun onCreate(savedInstanceState: Bundle?) - { + override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) } From 40cb5647ccb627a2071c02902e9eeeefdbda3c12 Mon Sep 17 00:00:00 2001 From: code-schreiber Date: Fri, 14 Jun 2019 12:20:10 +0200 Subject: [PATCH 3/8] Show all AndroidLint errors and warnings --- Dangerfile | 8 ++++---- app/src/main/AndroidManifest.xml | 5 ++++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Dangerfile b/Dangerfile index 0a8beb7..e94dbbd 100644 --- a/Dangerfile +++ b/Dangerfile @@ -1,3 +1,5 @@ +# Docs and setup at https://danger.systems + # Sometimes it's a README fix, or something like that - which isn't relevant for # including in a project's CHANGELOG for example declared_trivial = github.pr_title.include? "#trivial" @@ -5,9 +7,6 @@ declared_trivial = github.pr_title.include? "#trivial" # Make it more obvious that a PR is a work in progress and shouldn't be merged yet warn("PR is classed as Work in Progress") if github.pr_title.include? "[WIP]" -# Warn when there is a big PR -warn("Big PR") if git.lines_of_code > 500 - # Give a warning if the PR description is empty warn("Please provide a PR description") if github.pr_body.length < 5 @@ -23,5 +22,6 @@ checkstyle_format.report "app/build/reports/ktlint/ktlintMainSourceSetCheck.xml" # AndroidLint android_lint.report_file = "app/build/reports/lint-results.xml" android_lint.skip_gradle_task = true -android_lint.severity = "Error" android_lint.lint(inline_mode: true) +# For projects with tons of warnings, you may want to filter only new/modified files +# android_lint.filtering = true diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 42faf5e..546e793 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,8 +1,11 @@ - + From 0c0d4a3539a553b746bdf02a945e43588af8d6ae Mon Sep 17 00:00:00 2001 From: code-schreiber Date: Fri, 14 Jun 2019 12:29:01 +0200 Subject: [PATCH 4/8] Don't fail gradle build because of ktlint --- app/build.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/app/build.gradle b/app/build.gradle index 6b4224f..2c461d5 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -24,6 +24,7 @@ android { ktlint { android = true + ignoreFailures = true reporters = [ReporterType.PLAIN, ReporterType.CHECKSTYLE] } From fdc7e31e7f7b3b0d38afb540eb11595adba4516a Mon Sep 17 00:00:00 2001 From: code-schreiber Date: Fri, 14 Jun 2019 12:31:23 +0200 Subject: [PATCH 5/8] Add detekt to gradle --- app/build.gradle | 1 + app/src/main/java/com/toolslab/reviewme/MainActivity.kt | 5 ++++- build.gradle | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 2c461d5..f2d83df 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -2,6 +2,7 @@ apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' apply plugin: "org.jlleitschuh.gradle.ktlint" +apply plugin: "io.gitlab.arturbosch.detekt" import org.jlleitschuh.gradle.ktlint.reporter.ReporterType diff --git a/app/src/main/java/com/toolslab/reviewme/MainActivity.kt b/app/src/main/java/com/toolslab/reviewme/MainActivity.kt index e684bba..d854d08 100644 --- a/app/src/main/java/com/toolslab/reviewme/MainActivity.kt +++ b/app/src/main/java/com/toolslab/reviewme/MainActivity.kt @@ -10,5 +10,8 @@ class MainActivity : AppCompatActivity() { setContentView(R.layout.activity_main) } -} + fun unusedPublicMethodWithoutDocs() { + + } +} diff --git a/build.gradle b/build.gradle index bbc8921..207012b 100644 --- a/build.gradle +++ b/build.gradle @@ -15,6 +15,7 @@ buildscript { plugins { id "org.jlleitschuh.gradle.ktlint" version "8.0.0" + id "io.gitlab.arturbosch.detekt" version "1.0.0-RC15" } allprojects { From f6b8aec7cc1cd9f9854f2905e2d8b5f0cfec12d2 Mon Sep 17 00:00:00 2001 From: code-schreiber Date: Fri, 14 Jun 2019 12:32:19 +0200 Subject: [PATCH 6/8] Generate detekt config using ./gradlew detektGenerateConfig --- app/default-detekt-config.yml | 536 ++++++++++++++++++++++++++++++++++ 1 file changed, 536 insertions(+) create mode 100644 app/default-detekt-config.yml diff --git a/app/default-detekt-config.yml b/app/default-detekt-config.yml new file mode 100644 index 0000000..081c14a --- /dev/null +++ b/app/default-detekt-config.yml @@ -0,0 +1,536 @@ +build: + maxIssues: 10 + weights: + # complexity: 2 + # LongParameterList: 1 + # style: 1 + # comments: 1 + +processors: + active: true + exclude: + # - 'FunctionCountProcessor' + # - 'PropertyCountProcessor' + # - 'ClassCountProcessor' + # - 'PackageCountProcessor' + # - 'KtFileCountProcessor' + +console-reports: + active: true + exclude: + # - 'ProjectStatisticsReport' + # - 'ComplexityReport' + # - 'NotificationReport' + # - 'FindingsReport' + # - 'BuildFailureReport' + +comments: + active: true + excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" + CommentOverPrivateFunction: + active: false + CommentOverPrivateProperty: + active: false + EndOfSentenceFormat: + active: false + endOfSentenceFormat: ([.?!][ \t\n\r\f<])|([.?!:]$) + UndocumentedPublicClass: + active: false + searchInNestedClass: true + searchInInnerClass: true + searchInInnerObject: true + searchInInnerInterface: true + UndocumentedPublicFunction: + active: false + +complexity: + active: true + ComplexCondition: + active: true + threshold: 4 + ComplexInterface: + active: false + threshold: 10 + includeStaticDeclarations: false + ComplexMethod: + active: true + threshold: 10 + ignoreSingleWhenExpression: false + ignoreSimpleWhenEntries: false + LabeledExpression: + active: false + ignoredLabels: "" + LargeClass: + active: true + threshold: 600 + LongMethod: + active: true + threshold: 60 + LongParameterList: + active: true + threshold: 6 + ignoreDefaultParameters: false + MethodOverloading: + active: false + threshold: 6 + NestedBlockDepth: + active: true + threshold: 4 + StringLiteralDuplication: + active: false + excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" + threshold: 3 + ignoreAnnotation: true + excludeStringsWithLessThan5Characters: true + ignoreStringsRegex: '$^' + TooManyFunctions: + active: true + excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" + thresholdInFiles: 11 + thresholdInClasses: 11 + thresholdInInterfaces: 11 + thresholdInObjects: 11 + thresholdInEnums: 11 + ignoreDeprecated: false + ignorePrivate: false + ignoreOverridden: false + +empty-blocks: + active: true + EmptyCatchBlock: + active: true + allowedExceptionNameRegex: "^(_|(ignore|expected).*)" + EmptyClassBlock: + active: true + EmptyDefaultConstructor: + active: true + EmptyDoWhileBlock: + active: true + EmptyElseBlock: + active: true + EmptyFinallyBlock: + active: true + EmptyForBlock: + active: true + EmptyFunctionBlock: + active: true + ignoreOverriddenFunctions: false + EmptyIfBlock: + active: true + EmptyInitBlock: + active: true + EmptyKtFile: + active: true + EmptySecondaryConstructor: + active: true + EmptyWhenBlock: + active: true + EmptyWhileBlock: + active: true + +exceptions: + active: true + ExceptionRaisedInUnexpectedLocation: + active: false + methodNames: 'toString,hashCode,equals,finalize' + InstanceOfCheckForException: + active: false + excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" + NotImplementedDeclaration: + active: false + PrintStackTrace: + active: false + RethrowCaughtException: + active: false + ReturnFromFinally: + active: false + SwallowedException: + active: false + ignoredExceptionTypes: 'InterruptedException,NumberFormatException,ParseException,MalformedURLException' + ThrowingExceptionFromFinally: + active: false + ThrowingExceptionInMain: + active: false + ThrowingExceptionsWithoutMessageOrCause: + active: false + exceptions: 'IllegalArgumentException,IllegalStateException,IOException' + ThrowingNewInstanceOfSameException: + active: false + TooGenericExceptionCaught: + active: true + excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" + exceptionNames: + - ArrayIndexOutOfBoundsException + - Error + - Exception + - IllegalMonitorStateException + - NullPointerException + - IndexOutOfBoundsException + - RuntimeException + - Throwable + allowedExceptionNameRegex: "^(_|(ignore|expected).*)" + TooGenericExceptionThrown: + active: true + exceptionNames: + - Error + - Exception + - Throwable + - RuntimeException + +formatting: + active: true + android: false + autoCorrect: true + ChainWrapping: + active: true + autoCorrect: true + CommentSpacing: + active: true + autoCorrect: true + Filename: + active: true + FinalNewline: + active: true + autoCorrect: true + ImportOrdering: + active: false + Indentation: + active: true + autoCorrect: true + indentSize: 4 + continuationIndentSize: 4 + MaximumLineLength: + active: true + maxLineLength: 120 + ModifierOrdering: + active: true + autoCorrect: true + NoBlankLineBeforeRbrace: + active: true + autoCorrect: true + NoConsecutiveBlankLines: + active: true + autoCorrect: true + NoEmptyClassBody: + active: true + autoCorrect: true + NoItParamInMultilineLambda: + active: false + NoLineBreakAfterElse: + active: true + autoCorrect: true + NoLineBreakBeforeAssignment: + active: true + autoCorrect: true + NoMultipleSpaces: + active: true + autoCorrect: true + NoSemicolons: + active: true + autoCorrect: true + NoTrailingSpaces: + active: true + autoCorrect: true + NoUnitReturn: + active: true + autoCorrect: true + NoUnusedImports: + active: true + autoCorrect: true + NoWildcardImports: + active: true + autoCorrect: true + PackageName: + active: true + autoCorrect: true + ParameterListWrapping: + active: true + autoCorrect: true + indentSize: 4 + SpacingAroundColon: + active: true + autoCorrect: true + SpacingAroundComma: + active: true + autoCorrect: true + SpacingAroundCurly: + active: true + autoCorrect: true + SpacingAroundKeyword: + active: true + autoCorrect: true + SpacingAroundOperators: + active: true + autoCorrect: true + SpacingAroundParens: + active: true + autoCorrect: true + SpacingAroundRangeOperator: + active: true + autoCorrect: true + StringTemplate: + active: true + autoCorrect: true + +naming: + active: true + ClassNaming: + active: true + excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" + classPattern: '[A-Z$][a-zA-Z0-9$]*' + ConstructorParameterNaming: + active: true + excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" + parameterPattern: '[a-z][A-Za-z0-9]*' + privateParameterPattern: '[a-z][A-Za-z0-9]*' + excludeClassPattern: '$^' + EnumNaming: + active: true + excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" + enumEntryPattern: '^[A-Z][_a-zA-Z0-9]*' + ForbiddenClassName: + active: false + excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" + forbiddenName: '' + FunctionMaxLength: + active: false + excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" + maximumFunctionNameLength: 30 + FunctionMinLength: + active: false + excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" + minimumFunctionNameLength: 3 + FunctionNaming: + active: true + excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" + functionPattern: '^([a-z$][a-zA-Z$0-9]*)|(`.*`)$' + excludeClassPattern: '$^' + ignoreOverridden: true + FunctionParameterNaming: + active: true + excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" + parameterPattern: '[a-z][A-Za-z0-9]*' + excludeClassPattern: '$^' + ignoreOverriddenFunctions: true + InvalidPackageDeclaration: + active: false + rootPackage: '' + MatchingDeclarationName: + active: true + MemberNameEqualsClassName: + active: false + ignoreOverriddenFunction: true + ObjectPropertyNaming: + active: true + excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" + constantPattern: '[A-Za-z][_A-Za-z0-9]*' + propertyPattern: '[A-Za-z][_A-Za-z0-9]*' + privatePropertyPattern: '(_)?[A-Za-z][_A-Za-z0-9]*' + PackageNaming: + active: true + excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" + packagePattern: '^[a-z]+(\.[a-z][A-Za-z0-9]*)*$' + TopLevelPropertyNaming: + active: true + excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" + constantPattern: '[A-Z][_A-Z0-9]*' + propertyPattern: '[A-Za-z][_A-Za-z0-9]*' + privatePropertyPattern: '_?[A-Za-z][_A-Za-z0-9]*' + VariableMaxLength: + active: false + excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" + maximumVariableNameLength: 64 + VariableMinLength: + active: false + excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" + minimumVariableNameLength: 1 + VariableNaming: + active: true + excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" + variablePattern: '[a-z][A-Za-z0-9]*' + privateVariablePattern: '(_)?[a-z][A-Za-z0-9]*' + excludeClassPattern: '$^' + ignoreOverridden: true + +performance: + active: true + ArrayPrimitive: + active: false + ForEachOnRange: + active: true + excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" + SpreadOperator: + active: true + excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" + UnnecessaryTemporaryInstantiation: + active: true + +potential-bugs: + active: true + DuplicateCaseInWhenExpression: + active: true + EqualsAlwaysReturnsTrueOrFalse: + active: false + EqualsWithHashCodeExist: + active: true + ExplicitGarbageCollectionCall: + active: true + InvalidRange: + active: false + IteratorHasNextCallsNextMethod: + active: false + IteratorNotThrowingNoSuchElementException: + active: false + LateinitUsage: + active: false + excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" + excludeAnnotatedProperties: "" + ignoreOnClassesPattern: "" + MissingWhenCase: + active: false + UnconditionalJumpStatementInLoop: + active: false + UnreachableCode: + active: true + UnsafeCallOnNullableType: + active: false + UnsafeCast: + active: false + UselessPostfixExpression: + active: false + WrongEqualsTypeParameter: + active: false + +style: + active: true + CollapsibleIfStatements: + active: false + DataClassContainsFunctions: + active: false + conversionFunctionPrefix: 'to' + DataClassShouldBeImmutable: + active: false + EqualsNullCall: + active: false + EqualsOnSignatureLine: + active: false + ExplicitItLambdaParameter: + active: false + ExpressionBodySyntax: + active: false + includeLineWrapping: false + ForbiddenComment: + active: true + values: 'TODO:,FIXME:,STOPSHIP:' + ForbiddenImport: + active: false + imports: '' + ForbiddenVoid: + active: false + ignoreOverridden: false + FunctionOnlyReturningConstant: + active: false + ignoreOverridableFunction: true + excludedFunctions: 'describeContents' + LoopWithTooManyJumpStatements: + active: false + maxJumpCount: 1 + MagicNumber: + active: true + excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" + ignoreNumbers: '-1,0,1,2' + ignoreHashCodeFunction: true + ignorePropertyDeclaration: false + ignoreConstantDeclaration: true + ignoreCompanionObjectPropertyDeclaration: true + ignoreAnnotation: false + ignoreNamedArgument: true + ignoreEnums: false + ignoreRanges: false + MandatoryBracesIfStatements: + active: false + MaxLineLength: + active: true + maxLineLength: 120 + excludePackageStatements: true + excludeImportStatements: true + excludeCommentStatements: false + MayBeConst: + active: false + ModifierOrder: + active: true + NestedClassesVisibility: + active: false + NewLineAtEndOfFile: + active: true + NoTabs: + active: false + OptionalAbstractKeyword: + active: true + OptionalUnit: + active: false + OptionalWhenBraces: + active: false + PreferToOverPairSyntax: + active: false + ProtectedMemberInFinalClass: + active: false + RedundantVisibilityModifierRule: + active: false + ReturnCount: + active: true + max: 2 + excludedFunctions: "equals" + excludeLabeled: false + excludeReturnFromLambda: true + SafeCast: + active: true + SerialVersionUIDInSerializableClass: + active: false + SpacingBetweenPackageAndImports: + active: false + ThrowsCount: + active: true + max: 2 + TrailingWhitespace: + active: false + UnderscoresInNumericLiterals: + active: false + acceptableDecimalLength: 5 + UnnecessaryAbstractClass: + active: false + excludeAnnotatedClasses: "dagger.Module" + UnnecessaryApply: + active: false + UnnecessaryInheritance: + active: false + UnnecessaryLet: + active: false + UnnecessaryParentheses: + active: false + UntilInsteadOfRangeTo: + active: false + UnusedImports: + active: false + UnusedPrivateClass: + active: false + UnusedPrivateMember: + active: false + allowedNames: "(_|ignored|expected|serialVersionUID)" + UseCheckOrError: + active: false + UseDataClass: + active: false + excludeAnnotatedClasses: "" + UseRequire: + active: false + UselessCallOnNotNull: + active: false + UtilityClassWithPublicConstructor: + active: false + VarCouldBeVal: + active: false + WildcardImport: + active: true + excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" + excludeImports: 'java.util.*,kotlinx.android.synthetic.*' From 17ea92e590ca18736e028143b9ada5ddf4b384af Mon Sep 17 00:00:00 2001 From: code-schreiber Date: Fri, 14 Jun 2019 12:36:14 +0200 Subject: [PATCH 7/8] Add detekt to CI process --- .travis.yml | 5 +++-- Dangerfile | 5 +++++ Gemfile | 1 + Gemfile.lock | 3 +++ 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5b947f4..8def22c 100755 --- a/.travis.yml +++ b/.travis.yml @@ -21,8 +21,9 @@ android: script: - ./gradlew build - - ./gradlew :app:ktlintCheck - - ./gradlew :app:lint + - ./gradlew detekt + - ./gradlew ktlintCheck + - ./gradlew lint - bundle install - bundle exec danger diff --git a/Dangerfile b/Dangerfile index e94dbbd..f68aa3a 100644 --- a/Dangerfile +++ b/Dangerfile @@ -25,3 +25,8 @@ android_lint.skip_gradle_task = true android_lint.lint(inline_mode: true) # For projects with tons of warnings, you may want to filter only new/modified files # android_lint.filtering = true + +kotlin_detekt.report_file = "app/build/reports/detekt/detekt.xml" +kotlin_detekt.skip_gradle_task = true +# kotlin_detekt.filtering = true +kotlin_detekt.detekt diff --git a/Gemfile b/Gemfile index f0a0bf6..89e9374 100644 --- a/Gemfile +++ b/Gemfile @@ -7,3 +7,4 @@ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" } gem 'danger' gem 'danger-checkstyle_format' gem 'danger-android_lint' +gem 'danger-kotlin_detekt' diff --git a/Gemfile.lock b/Gemfile.lock index 0ba0a7c..fd220d7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -32,6 +32,8 @@ GEM danger-checkstyle_format (0.1.1) danger-plugin-api (~> 1.0) ox (~> 2.0) + danger-kotlin_detekt (0.0.3) + danger-plugin-api (~> 1.0) danger-plugin-api (1.0.0) danger (> 2.0) faraday (0.15.4) @@ -70,6 +72,7 @@ DEPENDENCIES danger danger-android_lint danger-checkstyle_format + danger-kotlin_detekt BUNDLED WITH 1.17.1 From 745eb56a12531146c943e02dba7dddb142e478e2 Mon Sep 17 00:00:00 2001 From: code-schreiber Date: Fri, 14 Jun 2019 16:04:09 +0200 Subject: [PATCH 8/8] Break a detekt rule --- app/build.gradle | 4 ++++ app/src/main/java/com/toolslab/reviewme/MainActivity.kt | 5 +---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index f2d83df..57eb7b7 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -23,6 +23,10 @@ android { } } +detekt { + config = files("default-detekt-config.yml") +} + ktlint { android = true ignoreFailures = true diff --git a/app/src/main/java/com/toolslab/reviewme/MainActivity.kt b/app/src/main/java/com/toolslab/reviewme/MainActivity.kt index d854d08..7211758 100644 --- a/app/src/main/java/com/toolslab/reviewme/MainActivity.kt +++ b/app/src/main/java/com/toolslab/reviewme/MainActivity.kt @@ -8,10 +8,7 @@ class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) - } - - fun unusedPublicMethodWithoutDocs() { - + // TODO: Forgotten todo } }