I have a setting to automatically trim whitespace at the end of lines on save.

I found that the pre-commit gem was still warning me about trailing whitespace

Turns out that the file was in DOS mode and was saving ^M style line endings and pre-commit didn’t like it.

No amount of whitespace trimming would save the day. I ended up viewing the file in hex mode before I noticed.

Anyway, if you run into this issue, just do the following and re-save the file.

:set ff=unix