elvis_core icon indicating copy to clipboard operation
elvis_core copied to clipboard

macro_module_names false-positive

Open seriyps opened this issue 8 years ago • 1 comments

I use macroses to hide internal exception data structure.

I have .hrl file like

-define(MATCH_MY_ERROR, {my_error, _, _}).
-define(MATCH_MY_ERROR(ErrorTag), {my_error, ErrorTag, _}).

And inside my code I use constructions like

-include_lib("my_app/include/error.hrl").

try my_logick()
catch
    throw:?MATCH_MY_ERROR(bad_auth) ->
        % handle auth error
    throw:?MATCH_MY_ERROR(input_validation) ->
        % handle validation error
    throw:?MATCH_MY_ERROR ->
        % handle other application errors
end.

And elvis thinks that I use macros as function name placeholder, but that's not true.

seriyps avatar Jun 03 '16 15:06 seriyps

awesome catch, @seriyps !!

elbrujohalcon avatar Jun 03 '16 16:06 elbrujohalcon