refactor(bpapi): Un-chew formatting

This commit is contained in:
ieQu1 2022-05-12 10:41:31 +02:00
parent 41e5bda914
commit c39665edbd
1 changed files with 9 additions and 22 deletions

View File

@ -61,15 +61,13 @@
% TODO: handle pmap % TODO: handle pmap
-define(IGNORED_RPC_CALLS, "gen_rpc:nodes/0, emqx_rpc:unwrap_erpc/1"). -define(IGNORED_RPC_CALLS, "gen_rpc:nodes/0, emqx_rpc:unwrap_erpc/1").
%% List of business-layer functions that are exempt from the checks: %% List of business-layer functions that are exempt from the checks:
%% erlfmt-ignore
-define(EXEMPTIONS, -define(EXEMPTIONS,
% Reason: legacy code. A fun and a QC query are "emqx_mgmt_api:do_query/6," % Reason: legacy code. A fun and a QC query are
"emqx_mgmt_api:do_query/6," % passed in the args, it's futile to try to statically
% passed in the args, it's futile to try to statically % check it
% check it "emqx_plugin_libs_rule:cluster_call/3" % Reason: some sort of external plugin API that we
% don't want to break?
% Reason: some sort of external plugin API that we
"emqx_plugin_libs_rule:cluster_call/3"
% don't want to break?
). ).
-define(XREF, myxref). -define(XREF, myxref).
@ -260,22 +258,11 @@ prepare(#{reldir := RelDir, plt := PLT}) ->
logger:info("Loading PLT...", []), logger:info("Loading PLT...", []),
dialyzer_plt:from_file(PLT). dialyzer_plt:from_file(PLT).
%% erlfmt-ignore
find_remote_calls(_Opts) -> find_remote_calls(_Opts) ->
Query = Query =
"XC | (A - [" "XC | (A - ["?IGNORED_APPS"]:App - ["?IGNORED_MODULES"]:Mod - ["?EXEMPTIONS"])
?IGNORED_APPS || ((["?RPC_MODULES"] : Mod + ["?RPC_FUNCTIONS"]) - ["?IGNORED_RPC_CALLS"])",
"]:App - ["
?IGNORED_MODULES
"]:Mod - ["
?EXEMPTIONS
"])\n"
" || ((["
?RPC_MODULES
"] : Mod + ["
?RPC_FUNCTIONS
"]) - ["
?IGNORED_RPC_CALLS
"])",
{ok, Calls} = xref:q(?XREF, Query), {ok, Calls} = xref:q(?XREF, Query),
logger:info("Calls to RPC modules ~p", [Calls]), logger:info("Calls to RPC modules ~p", [Calls]),
{Callers, _Callees} = lists:unzip(Calls), {Callers, _Callees} = lists:unzip(Calls),