From 0b16f2dc2718f5fd91735479b58a98ce39e654f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mil=C3=A1n=20B=C3=B3r?= Date: Mon, 16 Sep 2024 13:20:13 +0200 Subject: [PATCH] fix exceptions --- src/elvis_text_style.erl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/elvis_text_style.erl b/src/elvis_text_style.erl index ed88fea8..eaeb44b1 100644 --- a/src/elvis_text_style.erl +++ b/src/elvis_text_style.erl @@ -93,9 +93,8 @@ check_atom_quotes([] = _AtomNodes, Acc) -> Acc; check_atom_quotes([AtomNode | RemainingAtomNodes], AccIn) -> AtomName = ktn_code:attr(text, AtomNode), - ValueAtomName = ktn_code:attr(value, AtomNode), - IsException = is_exception_prefer_quoted(ValueAtomName), + IsException = is_exception_prefer_quoted(AtomName), AccOut = case unicode:characters_to_list(AtomName, unicode) of @@ -210,9 +209,10 @@ is_atom_node(MaybeAtom) -> %% @private is_exception_prefer_quoted(Elem) -> KeyWords = - ['after', 'and', 'andalso', 'band', 'begin', 'bnot', 'bor', 'bsl', 'bsr', 'bxor', 'case', - 'catch', 'cond', 'div', 'end', 'fun', 'if', 'let', 'not', 'of', 'or', 'orelse', 'receive', - 'rem', 'try', 'when', 'xor', maybe], + ["'after'", "'and'", "'andalso'", "'band'", "'begin'", "'bnot'", "'bor'", "'bsl'", + "'bsr'", "'bxor'", "'case'", "'catch'", "'cond'", "'div'", "'end'", "'fun'", "'if'", + "'let'", "'not'", "'of'", "'or'", "'orelse'", "'receive'", "'rem'", "'try'", "'when'", + "'xor'", "'maybe'"], lists:member(Elem, KeyWords). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%