Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up
for free
Danger for Android
Daichi Furiya (Wasabeef)
October 25, 2017
Programming
4
1.3k
Danger for Android
Introduction to Danger for Android
Daichi Furiya (Wasabeef)
October 25, 2017
Tweet
Share
More Decks by Daichi Furiya (Wasabeef)
See All by Daichi Furiya (Wasabeef)
wasabeef
1
560
wasabeef
28
7.5k
wasabeef
0
120
wasabeef
2
770
wasabeef
16
12k
wasabeef
4
1.2k
wasabeef
1
350
wasabeef
5
900
wasabeef
6
4.9k
Other Decks in Programming
See All in Programming
freekmurze
0
190
shin1x1
0
590
hanakla
2
3k
loleg
0
190
fkubota
1
390
chichou
1
810
o0h
1
1.4k
kubode
0
180
hr01
0
1.6k
line_developers_tw
0
370
masayaaoyama
4
530
blendthink
0
390
Featured
See All Featured
bkeepers
52
4.1k
roundedbygravity
84
7.8k
chrislema
173
14k
tanoku
86
8.5k
mza
80
4.1k
rmw
11
740
reverentgeek
168
7.1k
davidbonilla
69
3.5k
holman
448
130k
kneath
294
39k
dougneiner
55
5.4k
moore
125
21k
Transcript
Danger × Android wasabeef Potatotips #44
About me 降矢 大地 (Daichi Furiya) Google Developer Expert @wasabeef_jp
wasabeef
None
コードレビューの自動化をCI上で行う Android Lint, Swift Lint, ESLint, HLint, CheckStyle Format.......
Danger
General
Kotlin lint (Ktlint)
Android Lint
Android Lint
Plugins
Plugins
How to Set Up
Gemfile / Dangerfile の用意 bundle install Bundle exec danger Danger
Gemfile
Gemfile gem "danger" gem "danger-android_lint" gem "danger-findbugs" gem "danger-checkstyle_format"
Dangerfile
Dangerfile for PR # WIP warn("Work in Progress") if github.pr_title.include?
“WIP" # BIG PR warn("Big PR > 1000") if git.lines_of_code > 1000 # NO ASSIGN has_assignee = github.pr_json[assignee] != nil warn("No Assign", sticky: false) unless has_assignee
Dangerfile for Android Lint # Android Lint android_lint.gradle_task = "app:lint"
android_lint.report_file = “path/lint-results.xml” android_lint.filtering = true android_lint.lint(inline_mode: true)
Dangerfile for ktlint # checkstyle for ktlint github.dismiss_out_of_range_messages checkstyle_format.base_path =
Dir.pwd checkstyle_format.report “path/ktlint-report.xml”
Gradle for configurations { ktlint } dependencies { ktlint 'com.github.shyiko:ktlint:0.10.0'
} task ktlint(type: Exec) { commandLine 'java', '-cp', configurations.ktlint.join(System.getProperty('path.separator')), 'com.github.shyiko.ktlint.Main', '--reporter=checkstyle', 'src/**/*.kt' def outputDirectory = "$buildDir/reports" def outputFile = "${outputDirectory}/ktlint-report.xml" ignoreExitValue = true doFirst { new File(outputDirectory).mkdirs() standardOutput = new FileOutputStream(outputFile) } } https://ktlint.github.io/
Execution
Execution // Single bundle exec danger // Multiple bundle exec
danger --dangerfile="app/Dangerfile" --danger_id=1 bundle exec danger --dangerfile="tv/Dangerfile" --danger_id=2
Conclusion
Thank you. twitter.com/wasabeef_jp wasabeef.jp github.com/wasabeef