nrwl / precise-commits

:sparkles: Painlessly apply Prettier by only formatting lines you have modified anyway!
MIT License
471 stars 20 forks source link

false positive --check-only #11

Open guillaumearm opened 6 years ago

guillaumearm commented 6 years ago

Hi, thanks for this awesome library, it looks fast.

precise-commits effectively verify only staged lines, but I think there is a bug.

It's a false positive, because staged lines is still failing and precise-commits say it's ok.

I think this problem is present without --check-only too.

ghost commented 6 years ago

I have a similiar problem with false positives, but is the other way around than your problem.

When I stage a line with good code formatting and run yarn precise-commits --check-only it tells me "No formatting changes required in file X" ✅

But when I edit in some bad code formatting in the same file without making any changes to the staging area I get "Invalid formatting detected in: X" ❌

I thought the whole point of this module was that only code in the staging area is checked.