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
vividmuimui
September 05, 2018
Programming
120
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
17
開発組織まわりで最近考えているあれこれ
vividmuimui
0
29
bundle-update.pdf
vividmuimui
0
130
Dependabot vs BundleUpdate+LockDiff
vividmuimui
0
100
あなたの知らないRuboCopの設定
vividmuimui
0
260
最近(2019/02/03)の #Ruby , #Rails , #Bundler 事情
vividmuimui
0
170
Jasperはいいぞ!
vividmuimui
0
55
tigとかaliasなし生活を送ってみて改めてgitを覚えてる話
vividmuimui
0
130
lock_diff の紹介
vividmuimui
0
110
Other Decks in Programming
See All in Programming
MIZARU@SPAJAM2026 第二回予選
1901drama
0
110
Can LLMs Replicate 4 Years of Compose Migration? Exploring the boundaries of automation with 279 XML files from a real product
makun
0
130
AIと壁打ちしながら進めるコスト管理
fufuhu
2
1.9k
週末にAI-DLCを本気で回したら$1,600溶けた
hbashimizu
0
130
Deep dive into the select statement (GopherCon UK)
jespino
0
170
in-process GraphQL のすすめ #ginzajs
izumin5210
4
1.5k
Go 1.27からのGODEBUG / Go 1.27 リリースパーティ #go127party
mazrean
0
310
一参加者から『中の人』へ 〜全通PHPerがブースに立って学んだ、カンファレンスを100倍楽しむコツ〜
wp_daisuke
0
120
[DroidKaigi 2026] Bring your own phones to Gradle Managed Devices
f2lk
0
110
go-spidermonkeyでAIエージェントのCode Modeを実装する
syumai
3
1.5k
PyO3 で既存 Python 評価器を Rust core 化する ー wasm-bindgen でブラウザにも配るための設計
kdash
1
410
AI時代に学ぶ 好きなルール 嫌いなルール Linter編
shorty5121
0
860
Featured
See All Featured
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
220
The Illustrated Children's Guide to Kubernetes
chrisshort
51
53k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Google's AI Overviews - The New Search
badams
0
1.6k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
260
Practical Orchestrator
shlominoach
191
12k
Paper Plane (Part 1)
katiecoart
PRO
1
10k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.5k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.6k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
120
120k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.4k
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