Closed Olivier-Boudeville closed 1 year ago
Sorry, I have still something to fix, the linting actually fails (with a rather vague message), whereas I thought it was ok
>ERL_FLAGS="-enable-feature all" rebar3 test
===> Verifying dependencies...
===> Analyzing applications...
===> Compiling rebar3_format
===> elvis analysis starting, this may take a while...
===> Linting failed
I will have to investigate
I found this page, tried with ERL_FLAGS="-enable-feature all" rebar3 test
with a few inline/define-like Elvis spec candidates:
apparently -elvis({elvis_style, no_debug_call}).
will just result in:
===> elvis analysis starting, this may take a while...
===> Linting failed
(no more information, even with DEBUG=1, no log file found either, I guess the linter is crashing)
whereas -elvis([{elvis_style, no_debug_call, disable}]).
seems to be accepted and taken into account
As for Hank:
-hank({unnecessary_function_argument, [{main, 1, 1}]}).
will result in a crash:- ===> Looking for code to kill with fire...
===> error analyzing files: {case_clause,
{unnecessary_function_argument,
[{main,1,1}]}}
Stack: [{lists,map,2,[{file,"lists.erl"},{line,1314}]},
{hank,'-analyze/5-lc$^3/1-2-',3,
[{file,"EDITED/Software/rebar3_format-my-fork-for-escript-notification/_build/default/plugins/rebar3_hank/src/hank.erl"},
{line,40}]},
Trying this time with -hank([{unnecessary_function_argument, [{main, 1, 1}]}]).
we have:
===> Looking for code to kill with fire...
===> The following ignore specs are no longer needed and can be removed:
* src/rebar3_format.erl: unnecessary_function_argument: [{main,1,1}]
===> The following pieces of code are dead and should be removed:
src/rebar3_format.erl:17: main/1 doesn't need its #1 argument
Actually unnecessary_function_argument
should have been unnecessary_function_arguments
.
So with the last version that I committed (https://github.com/AdRoll/rebar3_format/commit/41ffa167ad6e538d6833893ddfa060ccce6c7288), everything seems ok:
$ ERL_FLAGS="-enable-feature all" rebar3 test
===> Verifying dependencies...
===> Analyzing applications...
===> Compiling rebar3_format
===> elvis analysis starting, this may take a while...
===> Looking for code to kill with fire...
===> Verifying dependencies...
===> Analyzing applications...
===> Compiling rebar3_format
===> Dialyzer starting, this may take a while...
===> Updating plt...
===> Resolving project files...
===> Updating base plt...
===> Resolving base files...
===> Building with 206 files in EDITED/.cache/rebar3/rebar3_25.1_plt...
===> Copying EDITED/.cache/rebar3/rebar3_25.1_plt to EDITED/Software/rebar3_format-my-fork-for-escript-notification/_build/default/rebar3_25.1_plt...
===> Checking 206 files in _build/default/rebar3_25.1_plt...
===> Adding 23 files to _build/default/rebar3_25.1_plt...
===> Doing success typing analysis...
===> Resolving project warning files...
===> Analyzing 8 files with _build/default/rebar3_25.1_plt...
===> Verifying dependencies...
===> Analyzing applications...
===> Compiling rebar3_format
===> Running Common Test suites...
Common Test starting (cwd is EDITED/Software/rebar3_format-my-fork-for-escript-notification)
CWD set to: "EDITED/Software/rebar3_format-my-fork-for-escript-notification/_build/test/logs/ct_run.nonode@nohost.2022-11-11_20.02.00"
TEST INFO: 1 test(s), 26 case(s) in 5 suite(s)
Testing lib.rebar3_format: Starting test, 26 test cases
%%% complete_coverage_SUITE: ..........
%%% erlfmt_formatter_SUITE: .......
%%% otp_formatter_SUITE: ...
%%% sr_formatter_SUITE: ....
%%% test_app_SUITE: ..
Testing lib.rebar3_format: TEST COMPLETE, 26 ok, 0 failed of 26 test cases
Updating EDITED/Software/rebar3_format-my-fork-for-escript-notification/_build/test/logs/index.html ... done
Updating EDITED/Software/rebar3_format-my-fork-for-escript-notification/_build/test/logs/all_runs.html ... done
===> Verifying dependencies...
===> Analyzing applications...
===> Compiling rebar3_format
===> Performing cover analysis...
|------------------------|------------|
| module | coverage |
|------------------------|------------|
| default_formatter | 98% |
| erlfmt_formatter | 100% |
| otp_formatter | 94% |
| rebar3_ast_formatter | 96% |
| rebar3_format | 25% |
| rebar3_format_prv | 98% |
| rebar3_formatter | 100% |
| sr_formatter | 100% |
|------------------------|------------|
| total | 97% |
|------------------------|------------|
coverage calculated from:
EDITED/Software/rebar3_format-my-fork-for-escript-notification/_build/test/cover/ct.coverdata
cover summary written to: EDITED/Software/rebar3_format-my-fork-for-escript-notification/_build/test/cover/index.html
===> Verifying dependencies...
===> Analyzing applications...
===> Compiling rebar3_format
===> Running edoc for rebar3_format
I guess Elvis and Hank could better test their wild attributes!
Notifying that rebar_format must be run as a plugin, not as an escript.