ocaml-ppx / ocamlformat

Auto-formatter for OCaml code
MIT License
622 stars 175 forks source link

Improve the placement of begin..end attributes #2551

Closed Julow closed 4 months ago

Julow commented 4 months ago

The first commit fixes https://github.com/ocaml-ppx/ocamlformat/issues/2405 by adding parentheses around begin .. end [@attr] when needed by the context.

The second commit changes the formatting of that example to begin [@attr] .. end. This also removes the bug and makes the formatting nicer.