Skip to content

Instantly share code, notes, and snippets.

@JonathonFry
Created November 13, 2018 12:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JonathonFry/00d5a7b24e1a5fb3b70044b85c858e6b to your computer and use it in GitHub Desktop.
Save JonathonFry/00d5a7b24e1a5fb3b70044b85c858e6b to your computer and use it in GitHub Desktop.
Dangerfile for Android Danger usage
warn("PR is classed as Work in Progress") if bitbucket_cloud.pr_title.include? "[WIP]"
warn("Big PR") if git.lines_of_code > 500
junit_tests_dir = "**/test-results/**/*.xml"
Dir[junit_tests_dir].each do |file_name|
junit.parse file_name
junit.report
end
lint_dir = "**/reports/lint-results.xml"
Dir[lint_dir].each do |file_name|
android_lint.skip_gradle_task = true
android_lint.filtering = true
android_lint.report_file = file_name
android_lint.lint
end
checkstyle_dir = "**/checkstyle/checkstyle.xml"
Dir[checkstyle_dir].each do |file_name|
checkstyle_format.base_path = file_name
checkstyle_format.report file_name
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment