rebar3_format
rebar3_format copied to clipboard
Comment shifted "down" in a weird fashion
The bug: a comment is getting misplaced.
To reproduce use
-type transaction_error() :: no_workers
| not_owner | inet:posix(). % from gen_udp:send
and rebar3 format
on top of it.
Expected output is potentially
-type transaction_error() :: no_workers | not_owner | inet:posix(). % from gen_udp:send
but surely not (as is happening):
-type transaction_error() :: no_workers | not_owner | inet:posix().
% from gen_udp:send
Yes. This is a known issue. If you want to see something even funnier, try with multiple comments, like…
-type transaction_error() :: no_workers
| not_owner % this one will pop up wherever
| inet:posix(). % from gen_udp:send
We know about it but we can't promise that we'll fix it soon. In the meantime, when we're formatting stuff like this and find this bug, we just move the comments above the type definition manually. As in…
%% Possible errors in a transaction:
%% - no_workers: We failed to find a worker to run it
%% - not_owner: The caller doesn't own the udp port
%% - inet:posix(). coming from gen_udp:send
-type transaction_error() :: no_workers
| not_owner
| inet:posix().
It's related to #152
If you want to see something even funnier
😄, I don't want funny, I want "serious" 😛.
can't promise that we'll fix it soon
No hurry here, but I didn't want to lose the chance to report it. I'll give your workaround a go, in the meantime. Thanks.
This can't be solved until erl_syntax:attribute_arguments/2
quit messing around with node positions, i.e. erlang/otp#4529