Closed NAR closed 3 years ago
Have you tried adding the following attribute to your module(s)?
-elvis([{elvis_style, state_record_and_type, disable}]).
Now I tried, but still get the error. This is my source file:
-module(lint_bug).
-elvis([{elvis_style, state_record_and_type, disable}]).
-behavior(gen_server).
-export([handle_call/3, handle_cast/2, init/1]).
handle_call(_, _, _) ->
{reply, ok, []}.
handle_cast(_, _) ->
{noreply, []}.
init(_) ->
{ok, []}.
I have to add I'm using elvis
through the rebar3_lint
plugin, I need to check if using elvis
directly works or not...
I can confirm this is a bug. Thanks for reporting, @NAR
@paulo-ferraz-oliveira / @Licenser : Can it be that rebar3_lint
is still using an old version of elvis_core
? Maybe one without support for -elvis
or the generic ignore
property?
Yeah… I think that's it! We need a new release of elvis_core
. Stay tuned, @NAR … I'll coordinate with @paulo-ferraz-oliveira and @Licenser and let you know.
Yes, I would say that master
elvis_core
fixes that, but since it's not had a release, so hasn't rebar3_lint
. I was in the middle of finishing something for elvis_core
, rebased some stuff and got stuck with an unusable version :-) but master
is OK to release, if @elbrujohalcon's OK with this.
In the meantime could you check if the behavior persists by forcing (via either rebar.config
or rebar.lock
) the latest commit on elvis_core
?
@paulo-ferraz-oliveira / @Licenser : Can it be that
rebar3_lint
is still using an old version ofelvis_core
? Maybe one without support for-elvis
or the genericignore
property?
This is correct. Support for both the directive and the generic ignore is not released (or published to Hex.pm) in either elvis_core
or rebar3_lint
.
Also related: check https://github.com/inaka/elvis_core/blob/master/test/examples/pass_state_record_and_type_elvis_attr.erl (what @elbrujohalcon was referring to).
With the latest elvis_core
the
-elvis([{elvis_style, state_record_and_type, disable}]).
line suppresses the warning, I can confirm that. I could only test with elvis
and not with the rebar3_lint
plugin, but elvis
worked with the master
version of elvis_core
(didn't suppress the warning with 0.6.0
though).
Alright… I'll see if I can cut a release of elvis_core
next Monday.
Aaaaand… project-fifo/rebar3_lint#19
@NAR, I'm closing this since it's only a matter of releasing rebar3_lint
for your issue to be fixed. Let us know if further issues come up.
It is not possible to ignore the warnings from the
state_record_and_type
rule, the code does not check for theignore
option. It would be really cool if I could suppress this warning :-)