trailing whitespace on empty lines does not trigger rule #39

Closed
echorink opened this Issue Jul 24, 2012 · 6 comments

Projects

None yet

6 participants

@echorink

having whitespace on an empty line does not trigger the trailing-whitespace rule, even though leading whitespace might exist due to autoindenters... might be nice to have a separate rule for this corner case?

    # blahblah
    # next line contains trailing whitespace (really, though markdown strips it!)

EOF

was expecting it to trigger "Line 3 contains trailing whitespace"

@brysgo
Contributor
brysgo commented Aug 20, 2012

I suppose if other linters check empty lines for trailing whitespace we should be consistent. This is the regex we currently use:

    trailingWhitespace : /[^\s]+[\t ]+\r?$/
@clutchski
Owner

So, this was the original behaviour, but other folks didn't like that, so it was changed in #9. Maybe it's worth an option in the no_trailing_whitespace config?

@brysgo
Contributor
brysgo commented Sep 22, 2012

I think it would be good to have.

@thomasf
Contributor
thomasf commented Nov 7, 2012

i really agree

@dnephin
dnephin commented Oct 16, 2013

+1, I would like this as well

@AsaAyers AsaAyers closed this in f5259f2 Oct 20, 2013
@vaiwa
vaiwa commented Aug 26, 2015

Please add parameter 'allowed_in_empty_lines' to the documentation at http://www.coffeelint.org/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment