Upgrade to Pro — share decks privately, control downloads, hide ads and more …

CIサービス「Bitrise」を使って 最小限の労力でDanger + ktlintをGithubと連携させる

CIサービス「Bitrise」を使って 最小限の労力でDanger + ktlintをGithubと連携させる

Wataru Mizukami

June 28, 2019
Tweet

More Decks by Wataru Mizukami

Other Decks in Technology

Transcript

  1. Dangerの設定 (Dangerfile) Dangerfile
 github.dismiss_out_of_range_messages # Ignore inline messages which lay

    outside a diff's range of PR github.dismiss_out_of_range_messages # 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]" # ktlint checkstyle_format.base_path = Dir.pwd checkstyle_format.report 'app/build/reports/ktlint/ktlintMainSourceSetCheck.xml'
  2. Ktlintの設定 1 build.gradle.kts
 buildscript { repositories { // 略 maven(url

    = "https://plugins.gradle.org/m2/" ) } dependencies { // 略 classpath("org.jlleitschuh.gradle:ktlint-gradle:8.0.0" ) } } 

  3. Ktlintの設定 2 app/build.gradle.kts 
 plugins { id("org.jlleitschuh.gradle.ktlint" ) } //

    略 ktlint { version.set("0.31.0") android.set(true) reporters.set(setOf(ReporterType.CHECKSTYLE)) ignoreFailures .set(true) // NOTE: エラーで中断させないための設定 } 
 

  4. Bitriseの設定 4 Run Dangerを選択して、Access token for your projectに Githubのアクセストークンを設定する プライベート

    リポジトリ パブリックリ ポジトリ repoにチェックを入 れる public_repoにチェッ クを入れる アクセストークンの権限