Skip to content

Commit

Permalink
[rebar3_format-0.8.1] Upgrade the formatter to its latest version (#28)
Browse files Browse the repository at this point in the history
* [rebar3_format-0.8.1] Upgrade the formatter to its latest version

* [rebar3_format-0.8.1] Simplify
  • Loading branch information
Brujo Benavides committed Nov 24, 2020
1 parent 39bed03 commit 9b8c2bc
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 21 deletions.
4 changes: 2 additions & 2 deletions rebar.config
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
% -*- mode: erlang -*-
{erl_opts, [debug_info]}.

{deps, [{jiffy, "1.0.5"}, {erlexec, "1.10.9"}]}.
{deps, [{jiffy, "1.0.6"}, {erlexec, "1.10.9"}]}.


{plugins, [
rebar3_gpb_plugin,
rebar3_lint,
{rebar3_format, "~> 0.7.0"},
{rebar3_format, "~> 0.8.1"},
rebar3_hex
]}.

Expand Down
6 changes: 3 additions & 3 deletions rebar.lock
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{"1.2.0",
[{<<"erlexec">>,{pkg,<<"erlexec">>,<<"1.10.9">>},0},
{<<"jiffy">>,{pkg,<<"jiffy">>,<<"1.0.5">>},0}]}.
{<<"jiffy">>,{pkg,<<"jiffy">>,<<"1.0.6">>},0}]}.
[
{pkg_hash,[
{<<"erlexec">>, <<"3CBB3476F942BFB8B68B85721C21C1835061CF6DD35F5285C2362E85B100DDC7">>},
{<<"jiffy">>, <<"A69B58FAF7123534C20E1B0B7AE97AC52079CA02ED4B6989B4B380179CD63A54">>}]},
{<<"jiffy">>, <<"8F0AB1D44D72F9A80556EA559907B669574134911FECF836EEB3DB1D238A6899">>}]},
{pkg_hash_ext,[
{<<"erlexec">>, <<"271E5B5F2D91CDB9887EFE74D89026C199BFC69F074CADE0D08DAB60993FA14E">>},
{<<"jiffy">>, <<"B617A53F46AE84F20D0C38951367DC947A2CF8CFF922AA5C6AC6B64B8B052289">>}]}
{<<"jiffy">>, <<"6614F7B7EEF8DFE242BF7A74EFE68CEC49989F84C9E40C091F5A58792C65F1C8">>}]}
].
8 changes: 4 additions & 4 deletions src/erlmld_batch_processor.erl
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,9 @@ note_flush(State) ->

%% given an erlang timestamp, return the elapsed duration in milliseconds.
elapsed_ms(When) ->
trunc(timer:now_diff(
os:timestamp(), When)
/ 1.0e3).
timer:now_diff(
os:timestamp(), When)
div 1000.

%% start a watchdog timer, cancelling any which is outstanding. if the timer fires, it
%% will result in the current process exiting with a reason of 'watchdog_timeout'
Expand Down Expand Up @@ -357,7 +357,7 @@ is_sub_record(_) ->
equal_cpt(A, B) ->
maps:from_list(
gb_trees:to_list(checkpointable(A)))
==
==
maps:from_list(
gb_trees:to_list(checkpointable(B))).

Expand Down
17 changes: 8 additions & 9 deletions src/erlmld_runner.erl
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,14 @@ tempdir_path(Filename) ->
%% app_suffix value, and return that populated pathname.
build_properties(#{app_suffix := AppSuffix} = Opts) ->
Input = input_properties_file_path(),
Output =
tempdir_path("erlmld." ++
atom_to_list(case AppSuffix of
undefined ->
default;
_ ->
AppSuffix
end)
++ ".properties"),
Suffix =
atom_to_list(case AppSuffix of
undefined ->
default;
_ ->
AppSuffix
end),
Output = tempdir_path("erlmld." ++ Suffix ++ ".properties"),
{ok, Template} = file:read_file(Input),
{ok, Result} = apply_substitutions(Template, Opts),
ok = filelib:ensure_dir(Output),
Expand Down
10 changes: 7 additions & 3 deletions src/kpl_agg.erl
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,18 @@ count(#state{num_user_records = Num} = _State) ->
Num.

size_bytes(#state{agg_size_bytes = Size, agg_partition_key = PK} = _State) ->
byte_size(?KPL_AGG_MAGIC) + Size + ?MD5_DIGEST_BYTES +
PKSize =
case PK of
undefined ->
0;
_ ->
byte_size(PK)
end
+ byte_size(kpl_agg_pb:encode_msg(#'AggregatedRecord'{})).
end,
byte_size(?KPL_AGG_MAGIC)
+ Size
+ ?MD5_DIGEST_BYTES
+ PKSize
+ byte_size(kpl_agg_pb:encode_msg(#'AggregatedRecord'{})).

finish(#state{num_user_records = 0} = State) ->
{undefined, State};
Expand Down

0 comments on commit 9b8c2bc

Please sign in to comment.