Merge pull request #7423 from zmstone/style-erlfmt-emqx_enterprise_conf
style: erlfmt emqx enterprise conf
This commit is contained in:
commit
1d0e2e10c9
|
@ -4,3 +4,5 @@
|
||||||
4d3157743e0d3ac7e6c09f108f6e79c820fd9c00
|
4d3157743e0d3ac7e6c09f108f6e79c820fd9c00
|
||||||
# reformat lib-ee/emqx_license
|
# reformat lib-ee/emqx_license
|
||||||
4f396cceb84d79d5ef540e91c1a8420e8de74a56
|
4f396cceb84d79d5ef540e91c1a8420e8de74a56
|
||||||
|
# reformat lib-ee/emqx_enterprise_conf
|
||||||
|
1aa82992616ad848539a533a5cd20ba6f9071e5a
|
||||||
|
|
|
@ -1,2 +1,4 @@
|
||||||
{erl_opts, [debug_info]}.
|
{erl_opts, [debug_info]}.
|
||||||
{deps, []}.
|
{deps, []}.
|
||||||
|
|
||||||
|
{project_plugins, [erlfmt]}.
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
{application, emqx_enterprise_conf,
|
{application, emqx_enterprise_conf, [
|
||||||
[{description, "EMQX Enterprise configuration schema"},
|
{description, "EMQX Enterprise configuration schema"},
|
||||||
{vsn, "0.1.0"},
|
{vsn, "0.1.0"},
|
||||||
{registered, []},
|
{registered, []},
|
||||||
{applications,
|
{applications, [
|
||||||
[kernel,
|
kernel,
|
||||||
stdlib
|
stdlib
|
||||||
]},
|
]},
|
||||||
{env,[]},
|
{env, []},
|
||||||
{modules, []},
|
{modules, []},
|
||||||
|
|
||||||
{licenses, ["Apache 2.0"]},
|
{licenses, ["Apache 2.0"]},
|
||||||
{links, []}
|
{links, []}
|
||||||
]}.
|
]}.
|
||||||
|
|
|
@ -8,19 +8,19 @@
|
||||||
|
|
||||||
-export([namespace/0, roots/0, fields/1, translations/0, translation/1]).
|
-export([namespace/0, roots/0, fields/1, translations/0, translation/1]).
|
||||||
|
|
||||||
-define(EE_SCHEMA_MODULES, [emqx_license_schema
|
-define(EE_SCHEMA_MODULES, [emqx_license_schema]).
|
||||||
]).
|
|
||||||
|
|
||||||
namespace() ->
|
namespace() ->
|
||||||
emqx_conf_schema:namespace().
|
emqx_conf_schema:namespace().
|
||||||
|
|
||||||
roots() ->
|
roots() ->
|
||||||
lists:foldl(
|
lists:foldl(
|
||||||
fun(Module, Roots) ->
|
fun(Module, Roots) ->
|
||||||
Roots ++ Module:roots()
|
Roots ++ apply(Module, roots, [])
|
||||||
end,
|
end,
|
||||||
emqx_conf_schema:roots(),
|
emqx_conf_schema:roots(),
|
||||||
?EE_SCHEMA_MODULES).
|
?EE_SCHEMA_MODULES
|
||||||
|
).
|
||||||
|
|
||||||
fields(Name) ->
|
fields(Name) ->
|
||||||
emqx_conf_schema:fields(Name).
|
emqx_conf_schema:fields(Name).
|
||||||
|
|
|
@ -19,8 +19,9 @@ all() ->
|
||||||
|
|
||||||
t_namespace(_Config) ->
|
t_namespace(_Config) ->
|
||||||
?assertEqual(
|
?assertEqual(
|
||||||
emqx_conf_schema:namespace(),
|
emqx_conf_schema:namespace(),
|
||||||
emqx_enterprise_conf_schema:namespace()).
|
emqx_enterprise_conf_schema:namespace()
|
||||||
|
).
|
||||||
|
|
||||||
t_roots(_Config) ->
|
t_roots(_Config) ->
|
||||||
BaseRoots = emqx_conf_schema:roots(),
|
BaseRoots = emqx_conf_schema:roots(),
|
||||||
|
@ -28,19 +29,25 @@ t_roots(_Config) ->
|
||||||
|
|
||||||
?assertEqual([], BaseRoots -- EnterpriseRoots),
|
?assertEqual([], BaseRoots -- EnterpriseRoots),
|
||||||
|
|
||||||
?assert(lists:any(
|
?assert(
|
||||||
fun({license, _}) -> true;
|
lists:any(
|
||||||
(_) -> false
|
fun
|
||||||
end,
|
({license, _}) -> true;
|
||||||
EnterpriseRoots)).
|
(_) -> false
|
||||||
|
end,
|
||||||
|
EnterpriseRoots
|
||||||
|
)
|
||||||
|
).
|
||||||
|
|
||||||
t_fields(_Config) ->
|
t_fields(_Config) ->
|
||||||
?assertEqual(
|
?assertEqual(
|
||||||
emqx_conf_schema:fields("node"),
|
emqx_conf_schema:fields("node"),
|
||||||
emqx_enterprise_conf_schema:fields("node")).
|
emqx_enterprise_conf_schema:fields("node")
|
||||||
|
).
|
||||||
|
|
||||||
t_translations(_Config) ->
|
t_translations(_Config) ->
|
||||||
[Root | _] = emqx_enterprise_conf_schema:translations(),
|
[Root | _] = emqx_enterprise_conf_schema:translations(),
|
||||||
?assertEqual(
|
?assertEqual(
|
||||||
emqx_conf_schema:translation(Root),
|
emqx_conf_schema:translation(Root),
|
||||||
emqx_enterprise_conf_schema:translation(Root)).
|
emqx_enterprise_conf_schema:translation(Root)
|
||||||
|
).
|
||||||
|
|
|
@ -9,7 +9,7 @@ cd -P -- "$(dirname -- "$0")/.."
|
||||||
|
|
||||||
APPS=()
|
APPS=()
|
||||||
APPS+=( 'apps/emqx' 'apps/emqx_modules' )
|
APPS+=( 'apps/emqx' 'apps/emqx_modules' )
|
||||||
APPS+=( 'lib-ee/emqx_license' )
|
APPS+=( 'lib-ee/emqx_enterprise_conf' 'lib-ee/emqx_license' )
|
||||||
|
|
||||||
for app in "${APPS[@]}"; do
|
for app in "${APPS[@]}"; do
|
||||||
echo "$app ..."
|
echo "$app ..."
|
||||||
|
|
Loading…
Reference in New Issue