Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Danger CI
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
vividmuimui
September 05, 2018
Programming
110
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Danger CI
original
https://vividmuimui.github.io/slides/danger-systems/slides/
vividmuimui
September 05, 2018
More Decks by vividmuimui
See All by vividmuimui
あるチームでの技術選定で考えてること(外部向けに修正版)
vividmuimui
0
14
開発組織まわりで最近考えているあれこれ
vividmuimui
0
26
bundle-update.pdf
vividmuimui
0
130
Dependabot vs BundleUpdate+LockDiff
vividmuimui
0
92
あなたの知らないRuboCopの設定
vividmuimui
0
250
最近(2019/02/03)の #Ruby , #Rails , #Bundler 事情
vividmuimui
0
170
Jasperはいいぞ!
vividmuimui
0
54
tigとかaliasなし生活を送ってみて改めてgitを覚えてる話
vividmuimui
0
130
lock_diff の紹介
vividmuimui
0
100
Other Decks in Programming
See All in Programming
Creating Composable Callables in Contemporary C++
rollbear
0
170
さぁV100、メモリをお食べ・・・
nilpe
0
160
気づいたらRubyで100作品 ー クリエイティブコーディングが生活の一部になるまで / 100 Ruby Sketches Later: How Creative Coding Became Part of My Life
chobishiba
3
610
不変条件と整合性境界—ビジネスが決める設計判断と実現パターン / Invariants and Consistency Boundaries
nrslib
14
5.9k
ECSアプリログをFireLensでコスト削減しようとしたけど諦めた話 in Fargate×Node.js
akihisaikeda
2
4.2k
任せる範囲はこう広がった / How the Scope of AI Delegation Has Expanded
nrslib
0
160
1B+ /day規模のログを管理する技術
broadleaf
0
120
Mujeres en SEO Summit 2026 - Greatest Disaster Hits en Web Performance
guaca
0
210
これからAgentCoreを触る方へトレンドはGatewayです
har1101
2
290
Signal Forms: Details & Live Coding @enterJS 2026 in Mannheim
manfredsteyer
PRO
0
200
ADKを使って簡単にAIエージェントを作ってみよう
k1mu21
0
280
AI時代のUIはどこへ行く?その2!
yusukebe
22
7.5k
Featured
See All Featured
The SEO Collaboration Effect
kristinabergwall1
1
490
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
740
Color Theory Basics | Prateek | Gurzu
gurzu
0
370
Testing 201, or: Great Expectations
jmmastey
46
8.2k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
10k
The Cost Of JavaScript in 2023
addyosmani
55
10k
Google's AI Overviews - The New Search
badams
0
1k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.5k
Producing Creativity
orderedlist
PRO
348
40k
Crafting Experiences
bethany
1
190
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
490
How GitHub (no longer) Works
holman
316
150k
Transcript
Danger Danger 2018/09/05 社内LT @vividmuimui 1
https://danger.systems/ruby/ 2
Danger とは Danger とは
https://github.com/vividmuimui/danger-sample/pull/7 3
Danger とは Danger とは レビューbot 用のツール js とruby で提供されている 4
サンプル サンプル # PR WIP warn("PR is classed as Work
in Progress") if github.pr_title.include? "[WIP]" # PR 変更行数 500以上 warn("Big PR") if git.lines_of_code > 500 # 普通 ruby 放題 fail("fdescribe left in tests") if `grep -r fdescribe specs/ `.length > 1 fail("fit left in tests") if `grep -r fit specs/ `.length > 1 # rubocop 使 plugin rubocop.lint inline_comment: true 5
メリット メリット 各種CI やgit のホスティングサービスをサポートしている rubocop などのよく使うどころはプラグインがある プラグインの中見てもだいぶシンプルなので、カスタマイズや自作 も簡単 チーム独自のルールや簡単にかける
ruby(js) を書けばいいだけなので簡単&やりたい放題 たとえば を編集したけど を編集して なければ警告など 6
使い方 使い方 注意: ruby, Github, CircleCI での話です。雰囲気で読み取ってください。 7
コメント コメント # PR message "foo bar" # markdown markdown
":alert:" # CI 落 fail "This build didn't pass tests" # :alert: warn "Big PR" # file changed warn("xxxxxx", file: "Dangerfile", line: 10) 8
Git, Github Git, Github git.added_files git.modified_files git.deleted_files git.lines_of_code # warn("")
if git.commits.any? { |c| c.message =~ /^Merge branch 'master'/ } # diff diff = git.diff_for_file("Gemfile.lock") message("") if diff && diff.patch =~ "nokogiri" github.pr_title github.pr_body github.pr_labels github.branch_for_base # review github.review.start github.review.fail(message) github.review.warn(message) github.review.submit 9
コードの共有 コードの共有 gem としてplugin を追加する以外にも色んな方法で追加できる # github 直指定 device_grid =
"https://raw.githubusercontent.com/fastlane/fastlane/master/danger-device_grid/ danger.import_plugin(device_grid) # local file danger.import_plugin("danger/plugins/watch_plugin.rb") danger.import_plugin("danger/plugins/*.rb") danger.import_dangerfile(path: "path/to/Dangerfile") # gem danger.import_dangerfile(gem: "ruby-grape-danger") # github, gitlab danger.import_dangerfile(gitlab: "ruby-grape/danger") danger.import_dangerfile( github: "ruby-grape/danger", branch: "custom", path: "path/to/Dangerfile" ) 10
導入の仕方 導入の仕方 を用意 danger gem をinstall を設定 とかでdanger を実行 だけ!
11
ローカルでも動かせる ローカルでも動かせる ただ、対象にするPR が、そのブランチで一番最近マージされたPR を対象に しているっぽい( たぶん) Github でオープンになっているPR を対象に実行したりはできなそう(
未確認) danger pr --verbose 12
参考 参考 公式 試して動かしたやつ 参考プラグイン Github 検索 https://danger.systems https://github.com/vividmuimui/danger-sample https://github.com/vividmuimui/danger-sample/pull/7
https://github.com/ashfurrow/danger- rubocop/blob/master/lib/danger_plugin.rb https://github.com/search?q=warn+ lename%3ADanger le 13