Analyzing an analyzer - A dive into how RuboCop works
summary
RuboCop parses Ruby into an AST using the parser gem, walks that tree with RuboCop AST traversal so cops can implement focused on_ handlers, and performs fixes through a tree rewriter* that uses node.location.expression ranges to replace source. It runs iteratively (reprocessing after edits, risking loops), supports custom cops for migrations and deprecations, and ships a working autocorrector that solved many CI pain points. Project is ten years old and ≈270 million downloads.
AI-written summary · about
chapters (5)
related talks
35mRuboCop Sent You a Friend Request
27mSquashing Security Bugs with Rubocop
41mWriting Lint for Ruby
28mROLE MODELS ARE IMPORTANT: RUBOCOP
21mBlazing-fast Code Indexing for Smarter Ruby Tools
23mEmbracing Code Quality with Rubocop
32mSAST and Sensibility: A Rubyist’s Guide to Static...
32mExploring RuboCop with MCP
