Exports given by prettypr:
-export([block_fragment/1, format/1, new/2,
promised_stream_id/1, read_binary/2, to_binary/1,
to_frame/4]).
becomes
-export([block_fragment/1,
format/1,
new/2,
promised_stream_id/1,
read_binary/2,
to_binary/1,
to_frame/4]).
or at the very least:
-export([block_fragment/1, format/1, new/2,
promised_stream_id/1, read_binary/2,
to_binary/1, to_frame/4]).
This one I'm not sure why it is a new line, keeping it one line is only 63 chars:
promised_stream_id(#push_promise{promised_stream_id =
PSID}) ->
PSID.
Should be.
promised_stream_id(#push_promise{promised_stream_id = PSID}) ->
PSID.
And if it were over 80 then the variable PSID
should at least line up like:
promised_stream_id(#push_promise{promised_stream_id =
PSID}) ->
PSID.
This indentation of a record:
new(StreamId, Bin) ->
#push_promise{promised_stream_id = StreamId,
block_fragment = Bin}.
becomes:
new(StreamId, Bin) ->
#push_promise{promised_stream_id = StreamId,
block_fragment = Bin}.
Indentation of the right hand side of a bind with a newline because of length:
to_frame(StreamId, PStreamId, Headers, EncodeContext) ->
{ok, {HeadersToSend, NewContext}} =
hpack:encode(Headers, EncodeContext),
becomes:
to_frame(StreamId, PStreamId, Headers, EncodeContext) ->
{ok, {HeadersToSend, NewContext}} =
hpack:encode(Headers, EncodeContext),
Case statements should indent the body:
case ExitStrategy of
max_frame_size ->
s_send_what_we_can(SWS - SentBytes, MFS, NewS);
stream -> {SWS - SentBytes, NewS};
connection -> {0, NewS}
end;
becomes:
case ExitStrategy of
max_frame_size ->
s_send_what_we_can(SWS - SentBytes, MFS, NewS);
stream -> {SWS - SentBytes, NewS};
connection -> {0, NewS}
end;