Skip to content

Commit

Permalink
fix exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
Milán Bór authored and Milán Bór committed Sep 16, 2024
1 parent 9827d68 commit 0b16f2d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/elvis_text_style.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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).

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Expand Down

0 comments on commit 0b16f2d

Please sign in to comment.