Scalafix Workshop
summary
Scalafix performs automated, semantic-aware rewrites and linters by combining Scalameta trees with a semanticdb index, producing token-level patches that precisely edit source without reprinting whole files. Examples include automated migration of Cats 0.9→1.0 (co-product → EitherK and operator changes), a null-infer warning that spots inferred Any, and a simple literal rewrite demo. Rules compile on-the-fly from GitHub, tests use paired input/output projects, and the key helper is the replaceSymbol API that updates uses and imports.
AI-written summary · about
chapters (26)
- 0:00Start
- 2:09AGENDA
- 3:08WHAT IS SCALAFIX
- 4:33NOPROCEDURESYNTAX
- 5:16NOAUTOTUPLING
- 6:20REMOVECARTESIANBUILDER
- 7:16NOINFER
- 10:33MEANWHILE IN SWIFT
- 12:45LET'S START FROM THE ANSWER
- 13:06TOKENS
- 14:41SCALAC
- 15:12MACROS
- 15:46SCALAFMT
- 18:05WHAT SCALAFIX DOES INSTEAD
- 20:17META PROGRAMMING DEVTOOLS!
- 21:19TREES
- 22:24PARSER
- 22:46TREE MANIPULATION PRIMITIVES
- 23:15SEMANTIC API: DATABASE
- 24:33SEMANTIC API: NAMES
- 25:18SEMANTIC API: SYMBOLS
- 26:23SEMANTIC API: MESSAGES
- 27:04SEMANTIC API: SYNTHETICS (SUGARS)
- 28:17RECAP
- 29:37Patch
- 31:19SemanticdbIndex
related talks
50mMove fast and fix things
39mUnleashing Scalafix potential with custom rules
51mAutomate More Code With Scalameta
10mScalaF: Functional Refactoring Suggestions for Scala
29mMy Little Parser: Tooling is Magic
20mThey see me refactorin'. They hatin'
40mHow To (Semi-)Automate JavaScript Refactoring
42mHow We Built Tools That Scale to Millions of Lines of Code
