Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There's no ignore option for the state_record_and_type rule #551

Closed
NAR opened this issue Nov 20, 2020 · 13 comments
Closed

There's no ignore option for the state_record_and_type rule #551

NAR opened this issue Nov 20, 2020 · 13 comments
Labels

Comments

@NAR
Copy link

NAR commented Nov 20, 2020

It is not possible to ignore the warnings from the state_record_and_type rule, the code does not check for the ignore option. It would be really cool if I could suppress this warning :-)

@elbrujohalcon
Copy link
Member

Have you tried adding the following attribute to your module(s)?

-elvis([{elvis_style, state_record_and_type, disable}]).

@NAR
Copy link
Author

NAR commented Nov 20, 2020

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, []}.

@NAR
Copy link
Author

NAR commented Nov 20, 2020

I have to add I'm using elvis through the rebar3_lint plugin, I need to check if using elvis directly works or not...

@elbrujohalcon
Copy link
Member

I can confirm this is a bug. Thanks for reporting, @NAR

@elbrujohalcon
Copy link
Member

@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?

@elbrujohalcon
Copy link
Member

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.

@paulo-ferraz-oliveira
Copy link
Collaborator

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
Copy link
Collaborator

@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?

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.

@paulo-ferraz-oliveira
Copy link
Collaborator

@NAR
Copy link
Author

NAR commented Nov 20, 2020

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).

@elbrujohalcon
Copy link
Member

Alright… I'll see if I can cut a release of elvis_core next Monday.

@elbrujohalcon
Copy link
Member

Aaaaand… project-fifo/rebar3_lint#19

@paulo-ferraz-oliveira
Copy link
Collaborator

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants