From ceb0cb1f0ddaed19d5ee2a8a89df3b3f5bd1e04e Mon Sep 17 00:00:00 2001 From: Zsolt Laky Date: Fri, 7 Jun 2024 18:57:18 +0200 Subject: [PATCH] Add Line to relevant calls (#346) --- src/elvis_style.erl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/elvis_style.erl b/src/elvis_style.erl index 3477652..5329914 100644 --- a/src/elvis_style.erl +++ b/src/elvis_style.erl @@ -1025,7 +1025,7 @@ no_throw(Config, Target, RuleConfig) -> ThrowNodes = elvis_code:find(Zipper, Root), lists:foldl(fun(ThrowNode, AccIn) -> {Line, _} = ktn_code:attr(location, ThrowNode), - [elvis_result:new(item, ?NO_THROW_MSG, [Line]) | AccIn] + [elvis_result:new(item, ?NO_THROW_MSG, [Line], Line) | AccIn] end, [], ThrowNodes). @@ -1040,7 +1040,7 @@ no_dollar_space(Config, Target, RuleConfig) -> DollarSpaceNodes = elvis_code:find(IsDollarSpace, Root, Opts), lists:map(fun(ThrowNode) -> {Line, _} = ktn_code:attr(location, ThrowNode), - elvis_result:new(item, ?NO_DOLLAR_SPACE_MSG, [Line]) + elvis_result:new(item, ?NO_DOLLAR_SPACE_MSG, [Line], Line) end, DollarSpaceNodes). @@ -1079,7 +1079,7 @@ no_catch_expressions(Config, Target, RuleConfig) -> CatchNodes = elvis_code:find(fun is_catch_node/1, Root), lists:foldl(fun(CatchNode, Acc) -> {Line, _Col} = ktn_code:attr(location, CatchNode), - [elvis_result:new(item, ?NO_CATCH_EXPRESSIONS_MSG, [Line]) | Acc] + [elvis_result:new(item, ?NO_CATCH_EXPRESSIONS_MSG, [Line], Line) | Acc] end, [], CatchNodes).