Skip to content

Commit

Permalink
Fix hex.pm actions, dialyzer, revert plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
vkatsuba committed Feb 2, 2022
1 parent 97cfea2 commit b58d043
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/hex.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ jobs:
env:
HEX_API_KEY: ${{ secrets.HEX_API_KEY }}
run: |
rebar3 edoc_extensions
rebar3 edoc
rebar3 hex publish -r hexpm --yes
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Add the plugin to your rebar config:

For generate `doc` with new style, run:
```sh
$ rebar3 edoc_extensions
$ rebar3 edoc
```

<!-- Badges -->
Expand Down
8 changes: 4 additions & 4 deletions elvis.config
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
[{elvis_style, no_if_expression, disable},
{elvis_style, function_naming_convention, disable},
{elvis_style, no_tabs, disable},
{elvis_style, dont_repeat_yourself, disable}]},
#{dirs => ["test/**"],
filter => "*.erl",
ruleset => erl_files},
{elvis_style, dont_repeat_yourself, disable},
{elvis_style, no_nested_try_catch, disable},
{elvis_style, atom_naming_convention, disable},
{elvis_style, no_spec_with_records, disable}]},
#{dirs => ["."],
filter => "rebar.config",
ruleset => rebar_config},
Expand Down
9 changes: 6 additions & 3 deletions rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,14 @@
{minimum_otp_vsn, "23"}.

{project_plugins,
[{rebar3_hex, "~> 6.11.7"}, {rebar3_format, "~> 1.0.1"}, {rebar3_lint, "~> 1.0.1"}]}.
[{rebar3_hex, "~> 6.11.7"},
{rebar3_format, "~> 1.0.1"},
{rebar3_lint, "~> 1.0.1"},
{rebar3_edoc_extensions, "~> 0.2.4"}]}.

%{rebar3_hank, "~> 1.2.2"}

%{dialyzer, [{warnings, [no_return, unmatched_returns, error_handling, underspecs]}]}.
{dialyzer, [{warnings, [no_return, unmatched_returns, error_handling, underspecs]}]}.

{xref_checks,
[deprecated_function_calls, exports_not_used, locals_not_used, undefined_function_calls]}.
Expand All @@ -39,7 +42,7 @@

{cover_opts, [verbose]}.

{alias, [{test, [compile, format]}]}.
{alias, [{test, [compile, dialyzer, format, lint, {ct, "--verbose"}, cover, edoc]}]}.

{format,
[{ignore, ["src/*wrapper.erl", "src/*export.erl"]},
Expand Down
4 changes: 2 additions & 2 deletions src/rebar3_edoc_extensions_export.erl
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@

-export(['#root#'/4, '#element#'/5, '#text#'/1]).

-spec '#xml-inheritance#'() -> list().
-spec '#xml-inheritance#'() -> [].
'#xml-inheritance#'() -> [].

-spec '#text#'(term()) -> term().
'#text#'(Text) ->
xmerl_html:'#text#'(Text).

-spec '#root#'(term(), term(), term(), term()) -> term().
-spec '#root#'(term(), term(), [], term()) -> term().
'#root#'(Data, Attrs, [], E) ->
xmerl_html:'#root#'(Data, Attrs, [], E).

Expand Down
10 changes: 5 additions & 5 deletions src/rebar3_edoc_extensions_wrapper.erl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
module(Element, Options) ->
edoc_layout:module(Element, Options).

-spec overview(term(), term()) -> term().
-spec overview(term(), term()) -> [binary() | list()].
overview(Element, Options) ->
Overview = edoc_layout:overview(Element, Options),
patch_html(Overview).
Expand All @@ -27,7 +27,7 @@ overview(Element, Options) ->
type(Element) ->
edoc_layout:type(Element).

-spec run(list(), term()) -> list().
-spec run(#doclet_gen{}, tuple()) -> ok | no_return().
run(#doclet_gen{app = App} = Cmd, Ctxt) ->
ok = edoc_doclet:run(Cmd, Ctxt),
%% Ctxt is a #context{} record in Erlang 23 and #doclet_context{} in Erlang
Expand Down Expand Up @@ -69,7 +69,7 @@ patch_html(Html) ->
[{return, list}, ungreedy, dotall, global]),
Html4.

-spec add_toc(term(), list(), list()) -> list().
-spec add_toc(term(), binary(), list()) -> list().
add_toc(App, Html, Dir) ->
case generate_toc(Dir, App) of
undefined ->
Expand All @@ -82,7 +82,7 @@ add_toc(App, Html, Dir) ->
[{return, list}])
end.

-spec generate_toc(list(), term()) -> list().
-spec generate_toc([binary() | list()], term()) -> [binary() | list()] | undefined.
generate_toc(Dir, App) ->
case get_overview(Dir) of
undefined ->
Expand All @@ -95,7 +95,7 @@ generate_toc(Dir, App) ->
generate_toc1(Titles, 0, [], App)
end.

-spec generate_toc1(list(), integer(), list(), term()) -> list().
-spec generate_toc1([binary() | list()], integer(), list(), term()) -> [binary() | list()].
generate_toc1([Title | Rest], CurrentLevel, Result, App) ->
ReOpts = [{capture, all_but_first, list}],
{match, [Equals, Title1]} = re:run(Title, "^(=+) *(.*)", ReOpts),
Expand Down

0 comments on commit b58d043

Please sign in to comment.