question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Trailing whitespace not working

See original GitHub issue

I just installed pre-commit, added this .pre-commit-config.yaml file:

# See http://pre-commit.com for more information
# See http://pre-commit.com/hooks.html for more hooks
repos:
-   repo: https://github.com/pre-commit/pre-commit-hooks
    sha: v1.1.1
    hooks:
    -   id: trailing-whitespace

and added a trailing space to a line in a file in the project, staged it, and when I commit it, it commits with the space, instead of removing it.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:14 (14 by maintainers)

github_iconTop GitHub Comments

2reactions
asottilecommented, Nov 27, 2017

Yep, this approach was taken as hooks can sometimes be wrong and it allows the human some chance to double check the machine.

0reactions
revoltercommented, Nov 27, 2017

Neither did I 😂 We go lucky I found it by mistake and fixed it easily, so others wouldn’t suffer.

Read more comments on GitHub >

github_iconTop Results From Across the Web

what is trailing whitespace and how can I handle this?
Trailing whitespace is any spaces or tabs after the last non-whitespace character on the line until the newline. In your posted question, there...
Read more >
Why is trailing whitespace a big deal? [closed]
Trailing whitespace is enough of a problem for programmers that editors like Emacs have special functions that highlight it or get rid of...
Read more >
Why isn't (sets-default show-trailing-whitespace t) working on ...
I am unable to get show-trailing-whitespace to work. Here is a test I did, emacs -q foo.txt. In Emacs I typed these commands,...
Read more >
no-trailing-spaces - ESLint - Pluggable JavaScript Linter
This rule disallows trailing whitespace (spaces, tabs, and other Unicode whitespace characters) at the end of lines. Examples of incorrect code for this...
Read more >
Remove Leading/Trailing Whitespace - R
x. a character vector. which. a character string specifying whether to remove both leading and trailing whitespace (default), or only leading ( "left"...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found