Skip to content

Commit

Permalink
Merge pull request #54 from nimblehq/chore/update-detekt-config-readm…
Browse files Browse the repository at this point in the history
…e-gradle

Update detekt Config, README, gradle version etc...
  • Loading branch information
sleepylee authored Oct 1, 2020
2 parents 3247076 + 2af941a commit 1f81d64
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 34 deletions.
26 changes: 25 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
![Build Status](https://www.bitrise.io/app/4cbfc6308f5c80e5/status.svg?token=FXilfAPD1nT8M1QzlfBNqA&branch=kotlin)
# Android Templates: Kotlin
- Our optimized Android templates used in our kotlin android projects
- Our optimized Android templates used in our kotlin android projects

### Setup
- Clone the project
- Checkout our main development branch `kotlin`
- Run the project with Android Studio


### Linter and static code analysis

1. Check Style:

```
$ ./gradlew checkStyle
```

Report is located at: `./app/build/reports/checkstyle/`

2. Detekt

```
$ ./gradlew detekt
```

Report is located at: `./build/reports/detekt.html`
32 changes: 24 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ buildscript {
}

plugins {
id "io.gitlab.arturbosch.detekt" version "1.0.0.RC6-3"
id "io.gitlab.arturbosch.detekt" version "1.14.0"
}

allprojects {
Expand All @@ -79,12 +79,28 @@ task clean(type: Delete) {
}

detekt {
profile("main") {
input = "$projectDir"
config = "$project.rootDir/detekt-config.yml"
filters = ".*test.*,.*/resources/.*,.*/tmp/.*"
output = "${project.buildDir}/reports/detekt/"
parallel = true
disableDefaultRuleSets = false
toolVersion = "1.14.0"

input = files("app/src/main/java", "app/src/main/kotlin", "data/src/main/kotlin", "data/src/main/java")
parallel = false
config = files("detekt-config.yml")
buildUponDefaultConfig = false
disableDefaultRuleSets = false

debug = false
ignoreFailures = false

ignoredBuildTypes = ["release"]
ignoredFlavors = ["production"]

reports {
xml {
enabled = true
destination = file("build/reports/detekt.xml")
}
html {
enabled = true
destination = file("build/reports/detekt.html")
}
}
}
27 changes: 2 additions & 25 deletions detekt-config.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,3 @@
autoCorrect: true
failFast: false

test-pattern: # Configure exclusions for test sources
active: true
patterns: # Test file regexes
- '.*/test/.*'
- '.*Test.kt'
- '.*Spec.kt'
exclude-rule-sets:
- 'comments'
exclude-rules:
- 'NamingRules'
- 'WildcardImport'
- 'MagicNumber'
- 'MaxLineLength'
- 'LateinitUsage'
- 'StringLiteralDuplication'
- 'SpreadOperator'
- 'TooManyFunctions'

build:
maxIssues: 10
weights:
Expand Down Expand Up @@ -172,7 +151,7 @@ exceptions:
active: false
TooGenericExceptionCaught:
active: true
exceptions:
exceptionNames:
- ArrayIndexOutOfBoundsException
- Error
- Exception
Expand All @@ -183,7 +162,7 @@ exceptions:
- Throwable
TooGenericExceptionThrown:
active: true
exceptions:
exceptionNames:
- Error
- Exception
- NullPointerException
Expand Down Expand Up @@ -326,8 +305,6 @@ style:
active: false
OptionalAbstractKeyword:
active: true
OptionalReturnKeyword:
active: false
OptionalUnit:
active: false
OptionalWhenBraces:
Expand Down

0 comments on commit 1f81d64

Please sign in to comment.