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
260
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
More Decks by vividmuimui
See All by vividmuimui
あるチームでの技術選定で考えてること(外部向けに修正版)
vividmuimui
0
20
開発組織まわりで最近考えているあれこれ
vividmuimui
0
49
bundle-update.pdf
vividmuimui
0
130
Dependabot vs BundleUpdate+LockDiff
vividmuimui
0
110
最近(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
全ての永続トークンを、生まれる前に消し去りたい!
sylph01
2
960
半永久的に提供し続けられるプライベートクラウドを目指して ― 利用者の認知負荷を抑えるAPI抽象化とハードウェア世代交代の基盤設計
tomokon
0
500
なぜCTOを降りてFDEを選んだのか?〜なぜプロダクト企業がFDEで顧客の現場に踏み込むのか〜
gonta
1
210
Jetpack Compose Mechanisms
skydoves
3
820
IBM Bob でAI駆動開発『QC-Playbook』
ichirokano2
0
110
ソニーのクラウド共通基盤の変遷とAI時代の開発スタイルに合わせた進化 / The Journey of Sony’s Common Cloud Platform and Its Evolution for AI-Native Development
kenjiyoneyama
0
270
[ハンズオン]AIへの指示だけで「五目並べ」を作ってみよう
satoshi256kbyte
1
380
AI時代のコードレビューは人に向けるな、仕組みに向けろ
texmeijin
5
3.7k
【加筆修正版】Laravel のアプリケーションをどこにデプロイするか #phpcon_ehime
akase244
0
150
パスワード再設定メールのURLについて知っておこう
uyuki234
0
160
PumaからFalconに移行したRailsアプリケーションでの実践
falcon8823
0
170
コードレビューのボトルネックを"する側"と"される側"の両面から解消する
yub0n
2
1.6k
Featured
See All Featured
Heart Work Chapter 1 - Part 1
lfama
PRO
10
37k
SEO for Brand Visibility & Recognition
aleyda
0
4.8k
Accessibility Awareness
sabderemane
1
250
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.8k
[SF Ruby Conf 2025] Rails X
palkan
3
1.5k
How to build a perfect <img>
jonoalderson
1
6.1k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
430
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
520
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
1
280
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
410
Building a Scalable Design System with Sketch
lauravandoore
464
34k
Transcript
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