All comments must be haiku! Custom linting with RuboCop
summary
Workshop builds a custom RuboCop cop that enforces "all comments must be haiku" by checking comment blocks for three lines and a 5‑7‑5 syllable count. It uses the parser AST with comments, a syllable‑counting library to score lines, add_offense to flag violations, and a staged repo (step directories plus switch_step) for live debugging with pry. The node pattern matcher DSL narrows checks to methods named poetically; syllable library is imperfect and autocorrect for haiku is nontrivial.
AI-written summary · about
chapters (8)
- 0:00Start
- 1:00Scott Moore
- 1:22Carrie Silva
- 7:15Rubyparse
- 14:39Processed Source
- 48:42Node Pattern Dsl
- 49:48Node Pattern Debugger
- 51:12Node Patterns








