GigCityElixir 2023 - Greg Mefford and Matt Enlow
summary
Announcement of Styler: an open-source Elixir tool that automatically rewrites code to enforce style rules, implemented as an AST rewriter that uses AST and zipper to make targeted edits cheaply and correctly. It becomes invisible by running as a mix format plugin, fixes alias sorting, piping, collapsed defs, and comment placement, and empirically reduces CI Credo failures and speeds feedback loops (about 10% extra runtime over mix format but far fewer context switches).
AI-written summary · about
chapters (17)
- 0:00Introduction to Styler
- 1:06The problem with Credo
- 3:34Automation potential
- 5:41Proposing the solution
- 7:18Project goals
- 8:07Using AST for correctness
- 10:35Styler's opinions
- 12:31Handling comments
- 14:17Algorithm for layout
- 16:06Performance challenges
- 18:42The zipper data structure
- 20:56Ergonomics and speed
- 23:25Invisible integration
- 24:58Expected results
- 26:24Unexpected benefits
- 27:58Open sourcing Styler
- 30:05Closing and acknowledgments
