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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
26
bundle-update.pdf
vividmuimui
0
130
Dependabot vs BundleUpdate+LockDiff
vividmuimui
0
92
最近(2019/02/03)の #Ruby , #Rails , #Bundler 事情
vividmuimui
0
170
Jasperはいいぞ!
vividmuimui
0
54
Danger CI
vividmuimui
0
110
tigとかaliasなし生活を送ってみて改めてgitを覚えてる話
vividmuimui
0
130
lock_diff の紹介
vividmuimui
0
100
Other Decks in Programming
See All in Programming
ADKを使って簡単にAIエージェントを作ってみよう
k1mu21
0
280
1B+ /day規模のログを管理する技術
broadleaf
0
120
Contextとはなにか
chiroruxx
1
380
任せる範囲はこう広がった / How the Scope of AI Delegation Has Expanded
nrslib
0
160
LLMによるContent Moderationの本番運用の裏側と品質担保への挑戦
suikabar
3
790
Vue × Nuxt × Oxc どこまで使える?実運用の現在地
andpad
0
310
SREは、MCPとSRE Agentをこう使え!
kazumax55
0
120
ECSアプリログをFireLensでコスト削減しようとしたけど諦めた話 in Fargate×Node.js
akihisaikeda
2
4.2k
これからAgentCoreを触る方へトレンドはGatewayです
har1101
2
290
はてなアカウント基盤 State of the Union
cockscomb
1
910
Spring Security 実践 ─ GraphQL APIで実務に役立つ 認証・認可 を学ぶ
wagyu
0
260
フロントエンドとバックエンドで「1文字」を揃えよう
youkidearitai
PRO
0
750
Featured
See All Featured
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
540
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
170
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.2k
Side Projects
sachag
455
43k
Building AI with AI
inesmontani
PRO
1
1.1k
Navigating Team Friction
lara
192
16k
Building Flexible Design Systems
yeseniaperezcruz
330
40k
How to Talk to Developers About Accessibility
jct
2
260
Into the Great Unknown - MozCon
thekraken
41
2.6k
Art, The Web, and Tiny UX
lynnandtonic
304
22k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
750
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.2k
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