grunt-complexity icon indicating copy to clipboard operation
grunt-complexity copied to clipboard

Blank js files throw "Invalid Source" Error

Open samhmills opened this issue 9 years ago • 2 comments

Blank js files throw "Invalid Source" Error

Running "complexity:src" (complexity) task

Warning: Invalid source Use --force to continue.
Error: Invalid source
    . . .

Aborted due to warnings.

I think it would probably be better to either omit/ignore the error created by empty files and just skip over them in the source array (As I think it would be better not to halt the process because of this), or provide a better error message saying "Empty files cannot be analysed". Invalid source is a bit misleading in this regard, in my opinion.

Thanks in advance!

samhmills avatar Jun 29 '15 13:06 samhmills

I agree.

nhunzaker avatar Jun 29 '15 15:06 nhunzaker

Merged a fix to make the error message better. Seems like the next step would be to ignore empty files. What do you think?

In the mean time, https://github.com/vigetlabs/grunt-complexity/pull/37/commits/91dc55fa05eea28e78acac2882867c79cc21abc5 should eliminate the confusion.

https://github.com/vigetlabs/grunt-complexity/releases/tag/v0.4.0

nhunzaker avatar Aug 18 '16 11:08 nhunzaker