chore: don't gen example.conf in v5.0.0

This commit is contained in:
Zhongwen Deng 2022-05-30 22:01:25 +08:00
parent 9ec804ae03
commit 86113f3494
2 changed files with 11 additions and 6 deletions

View File

@ -27,6 +27,7 @@
-export([reset/2, reset/3]).
-export([dump_schema/1, dump_schema/3]).
-export([schema_module/0]).
-export([gen_example_conf/4]).
%% for rpc
-export([get_node_and_config/1]).
@ -144,8 +145,9 @@ dump_schema(Dir, SchemaModule, I18nFile) ->
lists:foreach(
fun(Lang) ->
gen_config_md(Dir, I18nFile, SchemaModule, Lang),
gen_hot_conf_schema_json(Dir, I18nFile, Lang),
gen_example_conf(Dir, I18nFile, SchemaModule, Lang)
gen_hot_conf_schema_json(Dir, I18nFile, Lang)
%% TODO
%%gen_example_conf(Dir, I18nFile, SchemaModule, Lang)
end,
[en, zh]
),

View File

@ -324,7 +324,10 @@ fmt_desc(_, _) ->
fmt_type(Type, Indent) ->
[Indent, ?COMMENT2, ?TYPE, Type, ?NL].
fmt_path(Path, Indent) -> [Indent, ?COMMENT2, ?PATH, hocon_schema:path(Path), ?NL].
fmt_path(Path, Indent) -> [Indent, ?COMMENT2, ?PATH, path(Path), ?NL].
path(Stack) when is_list(Stack) ->
string:join(lists:reverse(lists:map(fun str/1, Stack)), ".").
fmt_fix_header(Field, Type, Path, #{indent := Indent}) ->
[
@ -350,7 +353,7 @@ fmt_map_link2(Path0, ValueName, All, Opts) ->
{ok, #{paths := SubPaths}} -> SubPaths;
_ -> []
end,
PathStr = hocon_schema:path(Path0),
PathStr = path(Path0),
Path = bin(PathStr),
#{indent := Indent} = Opts,
case find_link(Opts, {map, PathStr}) of
@ -391,7 +394,7 @@ fmt_array_link(Type = #{elements := ElemT}, Path, Opts = #{indent := Indent}) ->
end.
link(Link, Indent) ->
[Indent, ?COMMENT2, ?LINK, hocon_schema:path(Link), ?NL].
[Indent, ?COMMENT2, ?LINK, path(Link), ?NL].
is_simple_type(Types) when is_list(Types) ->
lists:all(
@ -404,7 +407,7 @@ is_simple_type(Type) ->
is_simple_type([Type]).
need_comment_example(map, Opts, Path) ->
case find_link(Opts, {map, hocon_schema:path(Path)}) of
case find_link(Opts, {map, path(Path)}) of
{ok, _} -> false;
{error, not_found} -> true
end.