-
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
Parsing eunit macro ?debugVal fails with Error: function_clause #480
Comments
Hi @cypherfox , can you show us your elvis.config and Erlang/OTP version, please? |
Erlang/OTP: 20 I am using elvis_core (package 0.4.1) via https://github.com/timadorus/rebar3_lint" elvis.config
|
Never mind. I just realised that I am probably actually running elvis_core 0.3.6 due to rebar.lock file. I will clean this up and be back if need be. closing the issue for now. Please excuse the hubub |
Ok, I have verified that I am actualy using elvis_core 0.3.9. The error is still there. |
I created the project that I'm attaching here. $ erl -s init stop
Erlang/OTP 20 [erts-9.1] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:10] [hipe] [kernel-poll:false]
*** ERROR: Shell process terminated! ***
$ elvis rock
# src/elvis_function_fail.erl [FAIL]
- line_length
- Line 8 is too long: _I_added_this_line = to_get_a_warning, % and it's very very very very very long - a really really long long line - very long.
$ elvis --version
______ _
/ __/ / __(_)__
/ _// / |/ / (_-<
/___/_/|___/_/___/
Version: 0.4.1
Elvis Core Version: 0.3.9 Can you do the same? |
|
Ok, that looks like your elvis is not properly compiled. Which is weird since you have the same version of elvis that I have. Let's try this: Please replace your elvis executable with the one attached here and run |
I had my elvis freshly compiled just before running it ( |
I'm not sure what's going on there. I run the following commands here and it worked: $ git clone git@github.com:inaka/elvis.git
Cloning into 'elvis'...
remote: Counting objects: 2517, done.
remote: Total 2517 (delta 0), reused 0 (delta 0), pack-reused 2517
Receiving objects: 100% (2517/2517), 659.79 KiB | 413.00 KiB/s, done.
Resolving deltas: 100% (1713/1713), done.
$ cd elvis
$ rebar3 escriptize
…lots of output…
$ cd path/to/eff
$ ../path/to/elvis/_build/default/bin/elvis rock
# src/elvis_function_fail.erl [FAIL]
- line_length
- Line 8 is too long: _I_added_this_line = to_get_a_warning, % and it's very very very very very long - a really really long long line - very long. |
Maybe you can contact the authors of that rebar3 plugin and check if they're doing something different there. |
@cypherfox With a repo were we can reproduce the behaviour we could look into what the problem is with that plugin. Would it be possible for you to create it? |
@elbrujohalcon: but my local build failed independently of the rebar plugin. I followed the instructions on the elvis Readm to do a fresh install. I think this may be important: the rebar plugin will pull down elvis_core on each build and compile it fresh. I rust run it on both my local machine (Ubuntu on Windows) as well as my CI/CD Pipeline (the official erlang:latest image), and both created an elvis_core that will throw those errors. What plattforms are you compiling on? |
I'm on a macbook pro, with macOS High Sierra Version 10.13.4 and I install Erlang/OTP through kerl. As you can see above, I also followed the instructions on elvis' README.md, I think. |
@jfacorro This replicates the behaviour with the plugin: |
@cypherfox Thank you for the example repo! 😄 I've managed to reproduce the problem in
I think the problem is in the way |
@cypherfox UPDATE: I'm still looking into this. I now suspect the |
@cypherfox @elbrujohalcon Just opened a PR with a fix in Aleppo, once that's merged it will need to be propagated to |
Since katana-code is already updated with the change, I'll close this issue and open a new one to update dependencies in elvis_core and another one for updating this repo. |
Linting the following module gives me:
As far as I can tell this only happens with the
?debugVal
macro. I use the?debug*
eunit macros quite intensively in my tests and they all work fine.The complete code of the module is:
The text was updated successfully, but these errors were encountered: