diff --git a/.github/workflows/.gitlint b/.github/workflows/.gitlint index 510ff06..f42b01c 100644 --- a/.github/workflows/.gitlint +++ b/.github/workflows/.gitlint @@ -58,7 +58,7 @@ ignore=title-trailing-punctuation, T1, T2, T3, T4, T5, T6, T8, B1, B2, B3, B4, B # python-style regex that the commit-msg title must match # Note that the regex can contradict with other rules if not used correctly # (e.g. title-must-not-contain-word). -regex=^(ci|feat|fix|docs|style|refactor|test|chore|perf)(\(.+\))?: .+ +regex=^(build|ci|feat|fix|docs|style|refactor|test|chore|perf)(\(.+\))?: .+ # [body-max-line-length] # line-length=72 diff --git a/Makefile b/Makefile index e8b1ba9..2d5538a 100644 --- a/Makefile +++ b/Makefile @@ -1,14 +1,10 @@ -REBAR := $(CURDIR)/rebar3 +REBAR := rebar3 .PHONY: all all: es -$(REBAR): - @curl -k -f -L "https://github.com/emqx/rebar3/releases/download/3.19.0-emqx-6/rebar3" -o ./rebar3 - @chmod +x ./rebar3 - .PHONY: compile -compile: $(REBAR) +compile: $(REBAR) compile .PHONY: clean @@ -16,7 +12,7 @@ clean: distclean .PHONY: distclean distclean: - @rm -rf rebar3 _build erl_crash.dump rebar3.crashdump src/hocon_parser.erl src/hocon_scanner.erl + @rm -rf _build erl_crash.dump rebar3.crashdump src/hocon_parser.erl src/hocon_scanner.erl .PHONY: xref xref: @@ -40,7 +36,7 @@ dialyzer: compile .PHONY: es es: export HOCON_ESCRIPT = true -es: $(REBAR) +es: $(REBAR) as es escriptize .PHONY: elvis @@ -49,9 +45,9 @@ elvis: .PHONY: fmt erlfmt fmt: erlfmt -erlfmt: $(REBAR) +erlfmt: $(REBAR) fmt -w .PHONY: erlfmt-check -erlfmt-check: $(REBAR) +erlfmt-check: $(REBAR) fmt -c diff --git a/src/hocon_maps.erl b/src/hocon_maps.erl index acae809..2322c91 100644 --- a/src/hocon_maps.erl +++ b/src/hocon_maps.erl @@ -132,14 +132,17 @@ get(Path, Config, Default) -> V -> V end. -%% @doc get a child node from richmap, return value also a richmap. -%% `undefined' is returned if no value path. -%% Key (first arg) can be "foo.bar.baz" or ["foo.bar", "baz"] or ["foo", "bar", "baz"]. --spec deep_get(name() | [name()], config()) -> config() | undefined. +%% @doc Get a child node from richmap, return value may also be a richmap. +%% `undefined' is returned if no value found for the path. +%% `Path' can be `"foo.bar.baz"', `["foo.bar", "baz"]' or `["foo", "bar", "baz"]'. +-spec deep_get(name() | [name()], config()) -> term(). deep_get(Path, Conf) -> deep_get(Path, Conf, richmap). --spec deep_get(name() | [name()], config(), richmap | map) -> config() | undefined. +%% @doc Get a child node from map | richmap, return value may also be a map | richmap. +%% `undefined' is returned if no value found for the path. +%% `Path' can be `"foo.bar.baz"', `["foo.bar", "baz"]' or `["foo", "bar", "baz"]'. +-spec deep_get(name() | [name()], config(), richmap | map) -> term(). deep_get(Path, Conf, Format) -> do_get(hocon_util:split_path(Path), Conf, Format).