-
Notifications
You must be signed in to change notification settings - Fork 87
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
Change of behavior regarding defines? #512
Comments
Hi @bjosv. |
@bjosv Thank you for the comprehensive description in the issue 🥰. As @elbrujohalcon says we missed this change in behaviour and therefore failed to let people know. We should definitely add a test case that reflects the expected behaviour from |
@jfacorro, is something missing here, like the test case you talk about? Or can this be closed? |
@paulo-ferraz-oliveira I think I had the plan to include this new behaviour in the README or somewhere else where it made sense, but couldn't think of an ideal place. |
Hi!
When delivering a no-code PR to another project that uses Elvis I suddenly got a DRY error in the code. The travis build used the latest elvis master version and this indicates there has been a behavioral change in the later commits of elvis.
The issue I got was triggered by test code within src-files conditioned with `-ifdef(TEST).
It seems that elvis now checks all source code indifferent of ifdef's.
I did some digging and created a code example to run elvis on, to reproduce the issue:
https://github.com/bjosv/elvis_issue
When running elvis 0.4.2 (088b7ac)
elvis rock
i.e no issue
When running elvis from master (c55c59b)
elvis rock
# src/elvis_issue.erl [FAIL]
- dont_repeat_yourself
- The code in the following (LINE, COL) locations has the same structure: (13, 65), (16, 65).
This is part of the ifdef'ed test code.
What I have seen there are these interesting changes from 0.4.2 to master:
and this changes how the node-tree representing the code is created. The content seems to differs regarding ifdef's.
According to #321 elvis might ignore conditional compilation construct since a long time, but not in all cases as it seems.
Is elvis expected to handle conditionals, i.e ignore code within TEST scope?
Thanks!
The text was updated successfully, but these errors were encountered: