Describe the bug
If the parser fails to correctly parse a form (e.g. due to macros), it will (silently) destroy the formatting of the function. This is very bad, as it renders the formatter very unreliable to use on large/legacy (unformatted) code bases. If applied on a large code base, every single module would need to be reviewed to ensure that no functions have gotten their formatting destroyed.
Expected behavior
Of course, it would be preferrable that the formatter could parse all syntactically correct Erlang source files, but if the parser is unable to correctly parse the source file, it would be better to (1) print an error message stating that it failed to parse the file (and preferrably enough information to understand where the error occurred) and (2) leave the file unformatted.
Describe the bug If the parser fails to correctly parse a form (e.g. due to macros), it will (silently) destroy the formatting of the function. This is very bad, as it renders the formatter very unreliable to use on large/legacy (unformatted) code bases. If applied on a large code base, every single module would need to be reviewed to ensure that no functions have gotten their formatting destroyed.
Expected behavior Of course, it would be preferrable that the formatter could parse all syntactically correct Erlang source files, but if the parser is unable to correctly parse the source file, it would be better to (1) print an error message stating that it failed to parse the file (and preferrably enough information to understand where the error occurred) and (2) leave the file unformatted.