From 379a0889532b4d77e7a4e1d869df22b14944b15c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mil=C3=A1n=20B=C3=B3r?= Date: Fri, 18 Oct 2024 17:28:11 +0200 Subject: [PATCH] simplify node tuple --- src/elvis_style.erl | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/elvis_style.erl b/src/elvis_style.erl index d4da4df8..71560f5b 100644 --- a/src/elvis_style.erl +++ b/src/elvis_style.erl @@ -1131,12 +1131,11 @@ no_init_lists(Config, Target, RuleConfig) -> FunctionNodes = elvis_code:find(IsFunction, Root), ProcessFun = fun(FunctionNode) -> - Name = ktn_code:attr(name, FunctionNode), Location = ktn_code:attr(location, FunctionNode), Content = ktn_code:content(FunctionNode), lists:map(fun(Elem) -> Attributes = ktn_code:node_attr(pattern, Elem), - {Name, Location, Attributes} + {Location, Attributes} end, Content) end, @@ -1157,13 +1156,13 @@ no_init_lists(Config, Target, RuleConfig) -> end, IsBreakRule = - lists:all(fun({_, _, Attributes}) -> + lists:all(fun({_, Attributes}) -> length(lists:filter(fun(Elem) -> is_list_node(Elem) end, Attributes)) =:= 1 end, InitFuns), ResultFun = - fun({_, Location, _}) -> + fun({Location, _}) -> Info = [Location], Msg = ?NO_INIT_LISTS_MSG, elvis_result:new(item, Msg, Info, Location)