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
あなたの知らない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
17
開発組織まわりで最近考えているあれこれ
vividmuimui
0
29
bundle-update.pdf
vividmuimui
0
130
Dependabot vs BundleUpdate+LockDiff
vividmuimui
0
100
最近(2019/02/03)の #Ruby , #Rails , #Bundler 事情
vividmuimui
0
170
Jasperはいいぞ!
vividmuimui
0
55
Danger CI
vividmuimui
0
120
tigとかaliasなし生活を送ってみて改めてgitを覚えてる話
vividmuimui
0
130
lock_diff の紹介
vividmuimui
0
110
Other Decks in Programming
See All in Programming
DroidKaigi 2026 「個人開発という実験場: Android エンジニアが手にする4つの自由」
slashnephy
0
220
片田舎のおっさん、 Swift Buildのダイアモンド問題解決の不具合修正PRを出すが、解決方法がキャッシュをしないようにすることであり、ビルド時間が伸びると言われてマージされないので高速化もする/swiftbuild
yimajo
0
360
型解析で実現する Go の言語内 DSL / Conference に Go! タイムテーブルの歩き方 for Gophers
mazrean
0
130
MySQLとPostgreSQLって何が違うの?
akagami
PRO
0
170
GKE アップグレード前に知っておきたい Blue/Green と PDB の関係
stkk
0
150
PyConJP2026_wat_Python × Signal Processing: How to Draw Pictures with Sound Using Spectrogram Art
wat
0
670
RSSとCodexを使ってX投稿自動化してみた
ochtum
0
100
変化を抱擁するドキュメントの作り方 - ビジネスルール駆動開発がもたらす、コードとの新しい関係
ioki
2
110
Vibes Containers 〜AIで変わるコンテナ設計と運用〜
tkikuc
1
480
『寄り添うラジオ』をAIで作る 体験価値から逆算した、会話しないUXと品質設計
theoriatec2024
2
110
異なる設計思想のフレームワークを経験して得た学び
amekuhideki
2
1.5k
XHTMLが残したもの
yosuke_furukawa
PRO
1
410
Featured
See All Featured
Navigating Weather and Climate Data
rabernat
0
510
Typedesign – Prime Four
hannesfritz
42
3.2k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
410
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
270
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.4k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
480
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.6k
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
470
Site-Speed That Sticks
csswizardry
13
1.5k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.8k
Designing for Performance
lara
611
70k
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