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

Elvis seems to ignore -ifdef/-else/-endif conditionals and flags disabled code parts as DRY of enabled ones. #321

Closed
p-kraszewski opened this issue Jan 4, 2016 · 1 comment

Comments

@p-kraszewski
Copy link

Hi!

Elvis seems to ignore condidtional compilation constructs and treats everything as compilable. This leads to DRY errors, as (in my case) selected variants are mostly similar:

-ifdef(DIRTY).
% ...
mnesia:dirty_select(host, [{Query, [Guard], ['$_']}]).
% ...
-else.
% ...
mnesia:select(host, [{Query, [Guard], ['$_']}])
% ...
-endif,

generates

# myfile.erl [FAIL]
  - dont_repeat_yourself
    - The code in the following (LINE, COL) locations has the same structure: (X, 29), (Y, 27).

@elbrujohalcon
Copy link
Member

This is by design.

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

No branches or pull requests

3 participants