-
Notifications
You must be signed in to change notification settings - Fork 519
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
Add rebar3 as test xref
#2379
Comments
This would not necessarily work well, because One weird thing is that That means that if we ask of I'm not too sure how I feel about this. |
Even if we don't specifically consider option |
Since a "normal" analysis would contain something like undefined_function_calls,
locals_not_used,
exports_not_used,
deprecated_function_calls I guess I understand your argument better in this sense:
Closing... |
I mean you have the right to see value in xref running for tests of course, but yeah, I personally tend not to run it there. If you do want to run them there, there's still probably a way to get that going. My tendency though is to really worry more about what is in the source directories than the test directories in terms of quality. Maybe I shouldn't have that attitude in the first place, but that's the one I brought to this discussion. I might be wrong. (I similarly don't run Dialyzer on tests mostly because I sometimes cause failures on purpose in tests to see error-handling behaviour, and Dialyzer then complains about my tests failing on purpose) |
Don't get me wrong. I accepted your arguments, they made sense.
Yeah, I used to have the same approach, and even though static analysis doesn't solve the major underlying issues (like "knowing how to write tests") it's another tool I can use to help me improve.
No, no, you have every right to counter my arguments. That's why the issues are important, I guess. Now there's history in case somebody has the same issues in the future.
I do it, and then silence dialyzer where I need to. I prefer to make my intentions explicit ("I know I'm provoking an exception here, but let me signal that to the next developer"). In any case, if it gets too convoluted I remove the analysis altogether. |
Pre-Check
Environment
Current behaviour
rebar3 as test xref
doesn't analyze foldertest
withextra_src_dirs
set to[{"test", [{recursive, true}]}]
.Expected behaviour
I'd expect
rebar3 as test xref
to:as test
definesTEST
by default, already),extra_src_dirs
into account (for the analyzed directories),xref_extra_paths
into account (it's being done, as a reference for analysis).Extra info
I've tracked the source of my expectations issues to https://github.com/erlang/rebar3/blob/master/src/rebar_prv_xref.erl#L99.
A request similar to mine (but for
dialyzer
) has already been implemented here: #2190.The text was updated successfully, but these errors were encountered: