-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #84 from s2g090123/83-update-the-danger-plugin-in-ci
New: Update the danger workflow
- Loading branch information
Showing
10 changed files
with
126 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,22 @@ | ||
apply plugin: "io.gitlab.arturbosch.detekt" | ||
|
||
detekt { | ||
buildUponDefaultConfig = true | ||
parallel = true | ||
ignoreFailures = true | ||
config.setFrom("${rootProject.projectDir}/config/detekt/detekt_config.yml") | ||
buildUponDefaultConfig = true | ||
parallel = true | ||
ignoreFailures = true | ||
config.setFrom("${rootProject.projectDir}/config/detekt/detekt_config.yml") | ||
} | ||
|
||
tasks.named("detekt").configure { | ||
reports { | ||
html.required.set(true) | ||
xml.required.set(false) | ||
txt.required.set(false) | ||
sarif.required.set(false) | ||
md.required.set(false) | ||
html.outputLocation.set(file("$buildDir/reports/detekt/detekt.html")) | ||
} | ||
// Exclude specific files | ||
// exclude("**/*.kt") | ||
reports { | ||
html.required.set(true) | ||
xml.required.set(true) | ||
txt.required.set(false) | ||
sarif.required.set(false) | ||
md.required.set(false) | ||
html.outputLocation.set(file("$buildDir/reports/detekt/detekt.html")) | ||
xml.outputLocation.set(file("$buildDir/reports/detekt/detekt.xml")) | ||
} | ||
// Exclude specific files | ||
// exclude("**/*.kt") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
lint_dir = '**/build/reports/lint-results-debug.xml' | ||
Dir[lint_dir].each do |file_name| | ||
android_lint.skip_gradle_task = true | ||
android_lint.report_file = file_name | ||
android_lint.lint(inline_mode: true) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
detekt_dir = "**/build/reports/detekt/detekt.xml" | ||
Dir[detekt_dir].each do |file_name| | ||
kotlin_detekt.skip_gradle_task = true | ||
kotlin_detekt.report_file = file_name | ||
kotlin_detekt.detekt(inline_mode: true) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
ktlint_dir = [ | ||
"**/build/reports/ktlint/ktlintAndroidTestSourceSetCheck/ktlintAndroidTestSourceSetCheck.json", | ||
"**/build/reports/ktlint/ktlintMainSourceSetCheck/ktlintMainSourceSetCheck.json", | ||
"**/build/reports/ktlint/ktlintTestSourceSetCheck/ktlintTestSourceSetCheck.json" | ||
] | ||
ktlint_dir.each do |dir| | ||
Dir[dir].each do |file_name| | ||
ktlint.skip_lint = true | ||
ktlint.report_file = file_name | ||
ktlint.lint(inline_mode: true) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
message "Thanks @#{github.pr_author}!" | ||
|
||
# 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 | ||
|
||
# Warn to encourage a PR description | ||
warn("Please provide a summary in the PR description to make it easier to review") if github.pr_body.length == 0 | ||
|
||
# Warn to encourage that labels should have been used on the PR | ||
warn("Please add labels to this PR") if github.pr_labels.empty? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
source "https://rubygems.org" | ||
|
||
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" } | ||
|
||
gem 'danger-android_lint' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
source "https://rubygems.org" | ||
|
||
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" } | ||
|
||
gem 'oga' | ||
gem 'danger-kotlin_detekt' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
source "https://rubygems.org" | ||
|
||
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" } | ||
|
||
gem 'danger-ktlint' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
source "https://rubygems.org" | ||
|
||
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" } | ||
|
||
gem 'danger' |