Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
あなたの知らないRuboCopの設定
Search
vividmuimui
April 01, 2019
Programming
270
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
あなたの知らないRuboCopの設定
original:
https://vividmuimui.github.io/slides/rubocop_sekai/slides/
vividmuimui
April 01, 2019
Transcript
25 slides
RuboCop RuboCop 2019/04/03 LT @vividmuimui 1
RuboCop RuboCop RuboCop RuboCop 2
cop (inherit) 3 : URL inherit : inherit_mode : 3
: URL inherit : URL inherit 4
inherit( ) inherit( ) RuboCop inhert_from .rubocop_todo.yml inherit_gem Gem onkcop
, meowcop inherit_from: .rubocop_todo.yml inherit_gem: onkcop: - "config/rubocop.yml" - "config/rails.yml" 5
inherit_from inherit_from URL URL GitHub https://raw.githubusercontent.com/xxx Ruby Gem inherit_from: -
http://www.example.com/rubocop.yml 6
: inherit_mode : inherit_mode 7
1 1 ( : .rubocop.yml ) ( : .rubocop_todo.yml )
# .rubocop_todo.yml Style/CollectionMethods: PreferredMethods: collect: map # .rubocop.yml inherit_from: '.rubocop_todo.yml' Style/CollectionMethods: PreferredMethods: collect: collect # こっちの設定が有効 8
2 2 RuboCop Hash Array Hash Merge Array Override Array
Override Merge Yaml Array Hash ~ (Yaml null) Style/CollectionMethods: # hashの例 PreferredMethods: collect: map # arrayの例 Exclude: - 'foo/bar.rb' 9
inherit_mode inherit_mode inherit_mode Array Override Merge inherit_from: - 'shared.yml' inherit_mode:
merge: - Exclude Style/For: inherit_mode: override: - Exclude 10
: : 11
inherit_from Include/Exclude Cop inherit_from: .rubocop_todo.yml Style/CollectionMethods: Exclude: - 'foo/bar.rb' 12
inherit_from inherit_from inherit_from inherit_from .rubocop.yml ../ .rubocop_todo.yml # .rubocop.yml inherit_from:
'../.rubocop_todo.yml' 13
Include/Exclude Include/Exclude Style/CollectionMethods: Exclude: - 'foo/bar.rb' 14
15
Include/Exclude Include/Exclude 16
Include/Exclude Include/Exclude .rubocop .rubocop.yml .rubocop_todo.yml rubocop .my_rubocop_config.yml rubocop.yml ( )
17
rubocop . ├── config │ ├── .my_rubocop_config.yml │ ├── .rubocop_todo.yml
│ └── .rubocop.yml └── src └── sample.rb # .rubocop.yml inherit_from: - .my_rubocop_config.yml - .rubocop_todo.yml $ rubocop -c config/.rubocop.yml 18
. ├── config │ ├── .my_rubocop_config.yml │ ├── .rubocop_todo.yml │
└── .rubocop.yml └── src └── sample.rb # config/.rubocop.yml # config/.rubocop_todo.yml Style/CollectionMethods: Exclude: # .rubocopで始まるので、設定ファイルからの相対 - '../src/sample.rb' # config/.my_rubocop_config.yml Style/CollectionMethods: Exclude: # .rubocopではないので、実行ディレクトリからの相対 - 'src/sample.rb' 19
.rubocop.yml tools/rubocop/ ( .rubocop.yml ) 20
.rubocop rubocop src rubocop . ├── src │ └── server
│ └── test │ └── foo.rb └── tool └── rubocop └── config └── rubocopの設定ファイル $ rubocop -c ../tool/rubocop/config/{rubocopの設定フ
( tools/rubocop/config rubocop ) 21
.rubocop .rubocop test Cop .rubocop **/ .rubocop rubocop src src/server
# rubocopの設定ファイル Foo/BarCop: Exclude: - '**/test/**/*.rb' 22
23
: URL inherit inherit_from URL : inherit_mode Hash Merge, Array
Override inherit_mode Array Merge : inherit_from inherit_from Include/Exclude .rubocop tools/ .rubocop 24
More Decks by vividmuimui
See All by vividmuimui
あるチームでの技術選定で考えてること(外部向けに修正版)
vividmuimui
0
22
開発組織まわりで最近考えているあれこれ
vividmuimui
0
52
bundle-update.pdf
vividmuimui
0
130
Dependabot vs BundleUpdate+LockDiff
vividmuimui
0
120
最近(2019/02/03)の #Ruby , #Rails , #Bundler 事情
vividmuimui
0
170
Jasperはいいぞ!
vividmuimui
0
61
Danger CI
vividmuimui
0
120
tigとかaliasなし生活を送ってみて改めてgitを覚えてる話
vividmuimui
0
140
lock_diff の紹介
vividmuimui
0
110
Other Decks in Programming
See All in Programming
クラウドエージェントは、 何がそんなに便利なのか / what makes cloud agents so useful
rkaga
5
830
Vapor Mode でアクセシビリティは 壊れないか検証した話
fuqda
1
340
Goコンパイラを作ってGoをもっと理解する / Build a Go compiler to better understand Go
ikura_hamu
0
130
TS 7.0 で baseUrl が使えなくなった今、パスエイリアスをどうするか
bicstone
2
600
社内AIエージェント「Askワンバン」における コストチューニングの取り組み
t0yohei
0
170
Materialが消えた日 〜真っ白なFlutterキャンバスにRenderObjectで絵を描く〜
umigishiaoi
0
160
3回つくってわかった、 定期実行ジョブ基盤の本質情報
takai
4
3.8k
Herb in Rails 8.2: Your ERB views, now HTML-aware @ Kaigi on Rails 2026, Tokyo, Japan
marcoroth
2
430
自作Discord音声botをLambda MicroVMsに移行した話 / Migrating My Discord Voice Bot to Lambda MicroVMs
akihisaikeda
1
310
仕様駆動開発入門 (何を作るかを先に決めて渡す) | 目指せ Kiro マスター 05
inariku
PRO
2
120
Railsバージョンを4倍にした話
optim
0
1k
Next.js: The final boss of Web Performance
guaca
0
400
Featured
See All Featured
How to Ace a Technical Interview
jacobian
280
24k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
430
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.5k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
530
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
6
1.3k
Marketing to machines
jonoalderson
1
6k
WCS-LA-2024
lcolladotor
0
990
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
310
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.9k
AI: The stuff that nobody shows you
jnunemaker
PRO
11
1.3k
My Coaching Mixtape
mlcsv
0
390