stil4m/elm-analyse

Multiline comments leads to false unused dependency

Closed this issue · 4 comments

This issue was hard to find. I'm now able to reproduce it.

Issue

A multi line comment inside the code will lead to "Unused dependencies".

How to reproduce

Add {- TODO this is a test -} in line 54 in Tokens.elm.
https://github.com/stil4m/elm-syntax/blob/a8d006a0ded1e08e70d528bcf07aa50b429ba3d6/src/Elm/Parser/Tokens.elm#L54
image

Run elm-analyse (installed globally).

The code didn't change. But elm-analyse will now mention an unused dependency.

Unused dependencies:
- rtfeldman/hex

Notes

I chose elm-syntax repository, because I was digging in the source code. For this example it could potentially be any other repo.

elm-analyse -v
0.13.3

Thanks for reporting this +1. I'll look into it

@andys8 Thanks for bug report. I was able to catch two bugs in one go ;) (see commits).
I'll release 0.14.0 soon. With these changes and some more nice checks :).

Thanks again 👍

Thanks a lot