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
250
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
14
開発組織まわりで最近考えているあれこれ
vividmuimui
0
27
bundle-update.pdf
vividmuimui
0
130
Dependabot vs BundleUpdate+LockDiff
vividmuimui
0
96
最近(2019/02/03)の #Ruby , #Rails , #Bundler 事情
vividmuimui
0
170
Jasperはいいぞ!
vividmuimui
0
54
Danger CI
vividmuimui
0
120
tigとかaliasなし生活を送ってみて改めてgitを覚えてる話
vividmuimui
0
130
lock_diff の紹介
vividmuimui
0
100
Other Decks in Programming
See All in Programming
【やさしく解説 設計編・中級 #1】一つの車に、運転手は一人 ~ある倉庫システムの事例から~
panda728
PRO
0
190
JAWS-UG横浜 #102 AWSサ終供養LT会 成仏できない AWS サービスたち 〜本日、三体供養します〜
maroon1st
0
230
Claude Team Plan導入・ガイド
tk3fftk
0
230
AI がコードを書く時代における新卒エンジニアの仕事風景 (2026) / New Graduate Engineers in the Era of AI Coding (2026)
sushichan044
0
230
jsmini JavaScript Engine を作ってみた話
yosuke_furukawa
PRO
0
210
【やさしく解説 設計編 #0】DDDのコード、読めるのに分からない人へ
panda728
PRO
2
280
SREの積み重ねがAI駆動開発のガードレールになった ― 7つの実践/SRE Guardrails The 7
tomoyakitaura
8
5.4k
『コードを書く以外の』エンジニアリング〜課金基盤移行プロジェクト推進のためのTips4選
yuriko1211
0
540
Go言語とトイモデルで学ぶTransformerの気持ち / fukuokago23-transformer
monochromegane
0
140
Generative UI & AI-Assistants for Your Angular Solutions
manfredsteyer
PRO
0
120
分散システム、なんですぐ死んでしまうん?耐障害性を高めたいあなたのためのレジリエンスパターン入門
mshibuya
7
6.8k
信頼性について考えてみる(SRE NEXT 2026 miniLT)
hayama17
0
210
Featured
See All Featured
How to build a perfect <img>
jonoalderson
1
5.8k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
23k
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
760
We Have a Design System, Now What?
morganepeng
55
8.2k
Scaling GitHub
holman
464
140k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
270
AI: The stuff that nobody shows you
jnunemaker
PRO
9
840
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
880
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2.1k
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
620
Mind Mapping
helmedeiros
PRO
1
290
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