Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

%% == Dependencies and plugins ==

{deps, [{zipper, "1.1.0"}, {katana_code, "~> 2.1.0"}]}.
{deps, [{zipper, "1.1.0"}, {katana_code, "~> 2.3.1"}]}.

{project_plugins, [
{rebar3_hank, "~> 1.4.0"},
Expand Down
6 changes: 3 additions & 3 deletions rebar.lock
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{"1.2.0",
[{<<"katana_code">>,{pkg,<<"katana_code">>,<<"2.1.1">>},0},
[{<<"katana_code">>,{pkg,<<"katana_code">>,<<"2.3.1">>},0},
{<<"zipper">>,{pkg,<<"zipper">>,<<"1.1.0">>},0}]}.
[
{pkg_hash,[
{<<"katana_code">>, <<"9AC515E6B5AE4903CD7B6C9161ABFBA49B610B6F3E19E8F0542802A4316C2405">>},
{<<"katana_code">>, <<"0428F86785C2E0FE33025BA82C2A1742413E3491CA4BE1A8350461D9AAFBBCC7">>},
{<<"zipper">>, <<"FA775C01BCD33225BE89AF320C10CE61D23943109F4D5CA718551D0C492D7E35">>}]},
{pkg_hash_ext,[
{<<"katana_code">>, <<"0680F33525B9A882E6F4D3022518B15C46F648BD7B0DBE86900980FE1C291404">>},
{<<"katana_code">>, <<"4F825ABC63B991D989A0CC882F15DB691B7578FAD1538E0AB1A3CAB7A9805313">>},
{<<"zipper">>, <<"4644C83AE83EF3C09860CB5ED597B0C759FBBCD64AD5B00A62F51AE48AEF7535">>}]}
].
13 changes: 1 addition & 12 deletions src/elvis_style.erl
Original file line number Diff line number Diff line change
Expand Up @@ -639,23 +639,12 @@ variable_naming_convention(Config, Target, RuleConfig) ->

-type macro_names_config() :: #{ignore => [ignorable()], regex => string()}.

% There is a bug in ktn_code: https://github.com/inaka/katana-code/issues/87
-dialyzer({no_match, macro_names/3}).

-spec macro_names(elvis_config:config(), elvis_file:file(), macro_names_config()) ->
[elvis_result:item()].
macro_names(Config, Target, RuleConfig) ->
Root = get_root(Config, Target, RuleConfig),
Regexp = option(regex, RuleConfig, macro_names),
IsMacroDefine = fun(Node) ->
case ktn_code:type(Node) of
{atom, [_, _], define} ->
true;
_ ->
false
end
end,
MacroNodes = elvis_code:find(IsMacroDefine, Root, #{traverse => all, mode => node}),
MacroNodes = elvis_code:find_by_types([define], Root, #{traverse => all, mode => node}),
check_macro_names(Regexp, MacroNodes, _ResultsIn = []).

-spec macro_module_names(elvis_config:config(), elvis_file:file(), empty_rule_config()) ->
Expand Down