Some formatting options perform syntax transformations, meaning the Abstract Syntax Tree (AST) of the code might change. Use these with caution as they can potentially change the meaning of your code.
JuliaFormatter categorizes options using an emoji legend to indicate risk levels:
- 📐 Whitespace: Purely about whitespace (safest).
- ♻️ Syntax Normalization: Inserts elements like parentheses but does not change the AST.
- ⚠️ Syntax Transformation: Changes the AST, but transformations are conservatively scoped and generally safe.
- 🔥 Dangerous Syntax Transformation: Changes the AST in ways that are not conservatively scoped and can change code meaning.
pipe_to_function_call is currently the only option in this category.
Safety Guard: By default, JuliaFormatter does not perform syntax transformations inside macros or Exprs. To enable transformations inside macros, set transform_syntax_in_macros=true. There is no option to enable transformations inside Exprs as it would change the literal meaning of the expression.