Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing automatic code reviews #1

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
13 changes: 9 additions & 4 deletions Dangerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
# 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"

# 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

Expand All @@ -23,5 +22,11 @@ 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

kotlin_detekt.report_file = "app/build/reports/detekt/detekt.xml"
kotlin_detekt.skip_gradle_task = true
# kotlin_detekt.filtering = true
kotlin_detekt.detekt
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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'
3 changes: 3 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -70,6 +72,7 @@ DEPENDENCIES
danger
danger-android_lint
danger-checkstyle_format
danger-kotlin_detekt

BUNDLED WITH
1.17.1
6 changes: 6 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -22,8 +23,13 @@ android {
}
}

detekt {
config = files("default-detekt-config.yml")
}

ktlint {
android = true
ignoreFailures = true
reporters = [ReporterType.PLAIN, ReporterType.CHECKSTYLE]
}

Expand Down
Loading