style: erlfmt lib-ee/emqx_enterprise_conf
This commit is contained in:
parent
39d477e77c
commit
1aa8299261
|
@ -1,2 +1,4 @@
|
|||
{erl_opts, [debug_info]}.
|
||||
{deps, []}.
|
||||
|
||||
{project_plugins, [erlfmt]}.
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
{application, emqx_enterprise_conf,
|
||||
[{description, "EMQX Enterprise configuration schema"},
|
||||
{vsn, "0.1.0"},
|
||||
{registered, []},
|
||||
{applications,
|
||||
[kernel,
|
||||
stdlib
|
||||
]},
|
||||
{env,[]},
|
||||
{modules, []},
|
||||
{application, emqx_enterprise_conf, [
|
||||
{description, "EMQX Enterprise configuration schema"},
|
||||
{vsn, "0.1.0"},
|
||||
{registered, []},
|
||||
{applications, [
|
||||
kernel,
|
||||
stdlib
|
||||
]},
|
||||
{env, []},
|
||||
{modules, []},
|
||||
|
||||
{licenses, ["Apache 2.0"]},
|
||||
{links, []}
|
||||
]}.
|
||||
{licenses, ["Apache 2.0"]},
|
||||
{links, []}
|
||||
]}.
|
||||
|
|
|
@ -8,19 +8,19 @@
|
|||
|
||||
-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() ->
|
||||
emqx_conf_schema:namespace().
|
||||
|
||||
roots() ->
|
||||
lists:foldl(
|
||||
fun(Module, Roots) ->
|
||||
Roots ++ Module:roots()
|
||||
end,
|
||||
emqx_conf_schema:roots(),
|
||||
?EE_SCHEMA_MODULES).
|
||||
fun(Module, Roots) ->
|
||||
Roots ++ Module:roots()
|
||||
end,
|
||||
emqx_conf_schema:roots(),
|
||||
?EE_SCHEMA_MODULES
|
||||
).
|
||||
|
||||
fields(Name) ->
|
||||
emqx_conf_schema:fields(Name).
|
||||
|
|
|
@ -19,8 +19,9 @@ all() ->
|
|||
|
||||
t_namespace(_Config) ->
|
||||
?assertEqual(
|
||||
emqx_conf_schema:namespace(),
|
||||
emqx_enterprise_conf_schema:namespace()).
|
||||
emqx_conf_schema:namespace(),
|
||||
emqx_enterprise_conf_schema:namespace()
|
||||
).
|
||||
|
||||
t_roots(_Config) ->
|
||||
BaseRoots = emqx_conf_schema:roots(),
|
||||
|
@ -28,19 +29,25 @@ t_roots(_Config) ->
|
|||
|
||||
?assertEqual([], BaseRoots -- EnterpriseRoots),
|
||||
|
||||
?assert(lists:any(
|
||||
fun({license, _}) -> true;
|
||||
(_) -> false
|
||||
end,
|
||||
EnterpriseRoots)).
|
||||
?assert(
|
||||
lists:any(
|
||||
fun
|
||||
({license, _}) -> true;
|
||||
(_) -> false
|
||||
end,
|
||||
EnterpriseRoots
|
||||
)
|
||||
).
|
||||
|
||||
t_fields(_Config) ->
|
||||
?assertEqual(
|
||||
emqx_conf_schema:fields("node"),
|
||||
emqx_enterprise_conf_schema:fields("node")).
|
||||
emqx_conf_schema:fields("node"),
|
||||
emqx_enterprise_conf_schema:fields("node")
|
||||
).
|
||||
|
||||
t_translations(_Config) ->
|
||||
[Root | _] = emqx_enterprise_conf_schema:translations(),
|
||||
?assertEqual(
|
||||
emqx_conf_schema:translation(Root),
|
||||
emqx_enterprise_conf_schema:translation(Root)).
|
||||
emqx_conf_schema:translation(Root),
|
||||
emqx_enterprise_conf_schema:translation(Root)
|
||||
).
|
||||
|
|
Loading…
Reference in New Issue