Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for analysis under rebar3_hank #137

Merged
merged 3 commits into from
Jul 27, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@ jobs:
rebar3-version: '3.14'
- run: rebar3 xref
- run: rebar3 lint
- run: rebar3 hank
- run: rebar3 dialyzer
- run: rebar3 ct
8 changes: 2 additions & 6 deletions elvis.config
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,8 @@
{config,
[#{dirs => ["src", "test"],
filter => "*.erl",
ruleset => erl_files
},
#{dirs => ["."],
elbrujohalcon marked this conversation as resolved.
Show resolved Hide resolved
filter => "Makefile",
rules => [{elvis_project, protocol_for_deps_erlang_mk, #{regex => "(https://.*|[0-9]+([.][0-9]+)*)"}}],
ruleset => makefiles
ruleset => erl_files,
rules => [{elvis_style, atom_naming_convention, #{ regex => "^(([a-z][a-z0-9]*_?)*(_SUITE)?|basePath|swagger_2_0|openapi_3_0_0)$" }}]
elbrujohalcon marked this conversation as resolved.
Show resolved Hide resolved
},
#{dirs => ["."],
filter => "rebar.config",
Expand Down
16 changes: 15 additions & 1 deletion rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,18 @@

%% == Shell ==

{plugins, [rebar3_auto, {rebar3_lint, "0.2.0"}, rebar3_hex]}.
{project_plugins, [
rebar3_auto,
rebar3_lint,
elbrujohalcon marked this conversation as resolved.
Show resolved Hide resolved
rebar3_hex,
rebar3_hank
]}.

%% == hank ==

{hank, [
{ignore, [
{"example/**", unnecessary_function_arguments},
{"test/**", unnecessary_function_arguments}
]}
]}.
3 changes: 3 additions & 0 deletions src/cowboy_swagger.erl
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
-export([filter_cowboy_swagger_handler/1]).
-export([get_existing_definitions/1]).

% is_visible is used as a maps:filter/2 predicate, which requires a /2 arity function
-hank([{unnecessary_function_arguments, [is_visible/2]}]).
elbrujohalcon marked this conversation as resolved.
Show resolved Hide resolved

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Types.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Expand Down