RuboCop Sent You a Friend Request
summary
Demonstrates building a custom RuboCop linter by using Ruby AST pattern matchers and RuboCop’s depth‑first traversal to find nodes and flag unsafe uses of unscoped where the receiver is not a Constant. Shows adding configuration to allow named helper methods to bypass the check, packaging the Cop as a gem with a company style YAML, publishing it to RubyGems, and verifies the rule catches N+1/scope mistakes.
AI-written summary · about
chapters (16)
- 0:00Introduction
- 2:15Ruby AST overview
- 4:28RuboCop extends AST
- 8:04Pattern matching in RuboCop
- 11:37Traversing AST
- 12:00Popular RuboCop cops
- 16:00Create custom cop
- 17:03Build cop with generator
- 20:24Case study: rails_unscoped_over_non_model_constant
- 23:34Integrate cop into gem
- 24:17Publish gem and style guide
- 26:23Q&A
- 27:07DSL support
- 29:07AST challenges
- 30:56Adopting RuboCop cops
- 33:47Closing
related talks
29mAnalyzing an analyzer - A dive into how RuboCop works
27mSquashing Security Bugs with Rubocop
31mCommunicating with Cops
28mROLE MODELS ARE IMPORTANT: RUBOCOP
41mWriting Lint for Ruby
23mEmbracing Code Quality with Rubocop
21mBlazing-fast Code Indexing for Smarter Ruby Tools
32mExploring RuboCop with MCP
