mirror of
https://github.com/valitydev/dmt-client.git
synced 2024-11-06 01:15:22 +00:00
HG-273: use scoper for logs, fix lint, bump buitutils (#17)
This commit is contained in:
parent
93577c536d
commit
52183b5006
1
Jenkinsfile
vendored
1
Jenkinsfile
vendored
@ -1,4 +1,5 @@
|
||||
#!groovy
|
||||
// -*- mode: groovy -*-
|
||||
|
||||
def finalHook = {
|
||||
runStage('store CT logs') {
|
||||
|
2
builtils
2
builtils
@ -1 +1 @@
|
||||
Subproject commit b9a3a1d845b76b07bd964bbcb363a48249e2a0e7
|
||||
Subproject commit 8dd1d30e97e4db20c9da98a5ddb261b199402bc0
|
@ -9,5 +9,8 @@
|
||||
'Repository' => <<"dominant:8022/v1/domain/repository">>,
|
||||
'RepositoryClient' => <<"dominant:8022/v1/domain/repository_client">>
|
||||
}}
|
||||
]},
|
||||
{scoper, [
|
||||
{storage, scoper_storage_lager}
|
||||
]}
|
||||
].
|
57
elvis.config
Normal file
57
elvis.config
Normal file
@ -0,0 +1,57 @@
|
||||
[
|
||||
{elvis, [
|
||||
{config, [
|
||||
#{
|
||||
dirs => ["src", "test"],
|
||||
filter => "*.erl",
|
||||
rules => [
|
||||
{elvis_style, line_length, #{limit => 120, skip_comments => false}},
|
||||
{elvis_style, no_tabs},
|
||||
{elvis_style, no_trailing_whitespace},
|
||||
{elvis_style, macro_module_names},
|
||||
{elvis_style, operator_spaces, #{rules => [{right, ","}, {right, "++"}, {left, "++"}]}},
|
||||
{elvis_style, nesting_level, #{level => 3}},
|
||||
{elvis_style, god_modules, #{limit => 30}},
|
||||
{elvis_style, no_if_expression},
|
||||
{elvis_style, invalid_dynamic_call, #{ignore => [elvis]}},
|
||||
{elvis_style, used_ignored_variable},
|
||||
{elvis_style, no_behavior_info},
|
||||
{elvis_style, module_naming_convention, #{regex => "^([a-z][a-z0-9]*_?)*(_SUITE)?$"}},
|
||||
{elvis_style, function_naming_convention, #{regex => "^([a-z][a-z0-9]*_?)*$"}},
|
||||
{elvis_style, state_record_and_type},
|
||||
{elvis_style, no_spec_with_records},
|
||||
{elvis_style, dont_repeat_yourself, #{min_complexity => 15}},
|
||||
{elvis_style, no_debug_call, #{ignore => [elvis, elvis_utils]}}
|
||||
]
|
||||
},
|
||||
#{
|
||||
dirs => ["."],
|
||||
filter => "Makefile",
|
||||
ruleset => makefiles
|
||||
},
|
||||
#{
|
||||
dirs => ["."],
|
||||
filter => "elvis.config",
|
||||
ruleset => elvis_config
|
||||
},
|
||||
#{
|
||||
dirs => ["."],
|
||||
filter => "rebar.config",
|
||||
rules => [
|
||||
{elvis_style, line_length, #{limit => 120, skip_comments => false}},
|
||||
{elvis_style, no_tabs},
|
||||
{elvis_style, no_trailing_whitespace}
|
||||
]
|
||||
},
|
||||
#{
|
||||
dirs => ["src"],
|
||||
filter => "*.app.src",
|
||||
rules => [
|
||||
{elvis_style, line_length, #{limit => 120, skip_comments => false}},
|
||||
{elvis_style, no_tabs},
|
||||
{elvis_style, no_trailing_whitespace}
|
||||
]
|
||||
}
|
||||
]}
|
||||
]}
|
||||
].
|
@ -31,6 +31,7 @@
|
||||
{deps, [
|
||||
{genlib , {git, "https://github.com/rbkmoney/genlib.git", {branch, "master"}}},
|
||||
{woody , {git, "git@github.com:rbkmoney/woody_erlang.git", {branch, "master"}}},
|
||||
{scoper , {git, "git@github.com:rbkmoney/scoper.git", {branch, "master"}}},
|
||||
{dmt_core, {git, "git@github.com:rbkmoney/dmt_core.git", {branch, "master"}}},
|
||||
{dmsl , {git, "git@github.com:rbkmoney/damsel_erlang.git", {branch, "master"}}},
|
||||
{lager , "3.2.1"}
|
||||
|
10
rebar.lock
10
rebar.lock
@ -20,7 +20,11 @@
|
||||
{<<"lager">>,{pkg,<<"lager">>,<<"3.2.1">>},0},
|
||||
{<<"metrics">>,{pkg,<<"metrics">>,<<"1.0.1">>},2},
|
||||
{<<"mimerl">>,{pkg,<<"mimerl">>,<<"1.0.2">>},2},
|
||||
{<<"ranch">>,{pkg,<<"ranch">>,<<"1.3.2">>},2},
|
||||
{<<"ranch">>,{pkg,<<"ranch">>,<<"1.4.0">>},2},
|
||||
{<<"scoper">>,
|
||||
{git,"git@github.com:rbkmoney/scoper.git",
|
||||
{ref,"802057089bac258f45e35263eb2223961618468d"}},
|
||||
0},
|
||||
{<<"snowflake">>,
|
||||
{git,"https://github.com/rbkmoney/snowflake.git",
|
||||
{ref,"0a598108f6582affe3b4ae550fc5b9f2062e318a"}},
|
||||
@ -32,7 +36,7 @@
|
||||
1},
|
||||
{<<"woody">>,
|
||||
{git,"git@github.com:rbkmoney/woody_erlang.git",
|
||||
{ref,"992c279466e7eb1c24a9d9c6e7e8d66c597bc7e1"}},
|
||||
{ref,"ad1e91050c36d8de15f1c7d8dd8a2c682d2d158c"}},
|
||||
0}]}.
|
||||
[
|
||||
{pkg_hash,[
|
||||
@ -45,6 +49,6 @@
|
||||
{<<"lager">>, <<"EEF4E18B39E4195D37606D9088EA05BF1B745986CF8EC84F01D332456FE88D17">>},
|
||||
{<<"metrics">>, <<"25F094DEA2CDA98213CECC3AEFF09E940299D950904393B2A29D191C346A8486">>},
|
||||
{<<"mimerl">>, <<"993F9B0E084083405ED8252B99460C4F0563E41729AB42D9074FD5E52439BE88">>},
|
||||
{<<"ranch">>, <<"E4965A144DC9FBE70E5C077C65E73C57165416A901BD02EA899CFD95AA890986">>},
|
||||
{<<"ranch">>, <<"10272F95DA79340FA7E8774BA7930B901713D272905D0012B06CA6D994F8826B">>},
|
||||
{<<"ssl_verify_fun">>, <<"28A4D65B7F59893BC2C7DE786DEC1E1555BD742D336043FE644AE956C3497FBE">>}]}
|
||||
].
|
||||
|
@ -7,6 +7,7 @@
|
||||
stdlib,
|
||||
lager,
|
||||
woody,
|
||||
scoper,
|
||||
dmt_core
|
||||
]},
|
||||
{mod, {dmt_client, []}},
|
||||
|
@ -32,7 +32,7 @@ call(ServiceName, Function, Args) ->
|
||||
Call = {Service, Function, Args},
|
||||
Opts = #{
|
||||
url => Url,
|
||||
event_handler => {dmt_client_woody_event_handler, undefined}
|
||||
event_handler => scoper_woody_event_handler
|
||||
},
|
||||
Context = woody_context:new(),
|
||||
case woody_client:call(Call, Opts, Context) of
|
||||
|
@ -1,22 +0,0 @@
|
||||
-module(dmt_client_woody_event_handler).
|
||||
|
||||
-behaviour(woody_event_handler).
|
||||
|
||||
-export([handle_event/4]).
|
||||
|
||||
-spec handle_event(EventType, RpcID, EventMeta, Opts)
|
||||
-> _ when
|
||||
EventType :: woody_event_handler:event(),
|
||||
RpcID :: woody:rpc_id(),
|
||||
EventMeta :: woody_event_handler:event_meta(),
|
||||
Opts :: woody:options().
|
||||
|
||||
handle_event(EventType, RpcID, #{status := error, class := Class, reason := Reason, stack := Stack}, Opts) ->
|
||||
lager:error(
|
||||
maps:to_list(RpcID),
|
||||
"[server] ~s with ~s:~p at ~s~nOpts: ~p",
|
||||
[EventType, Class, Reason, genlib_format:format_stacktrace(Stack, [newlines]), Opts]
|
||||
);
|
||||
|
||||
handle_event(EventType, RpcID, EventMeta, Opts) ->
|
||||
lager:debug(maps:to_list(RpcID), "[server] ~s: ~p~nOpts: ~p", [EventType, EventMeta, Opts]).
|
Loading…
Reference in New Issue
Block a user