sindresorhus / atom-editorconfig

Helps developers maintain consistent coding styles between different editors
https://atom.io/packages/editorconfig
MIT License
812 stars 80 forks source link

Restrict trailing whitespace trimming only to lines that are not committed #174

Closed dmytrokyrychuk closed 7 years ago

dmytrokyrychuk commented 7 years ago

When a file is under version control and it contains trailing whitespace, saving it would cause trailing whitespace to be trimmed on all lines of the file, which would add unnecessary noise to the diff.

I would like to suggest an option to restrict whitespace trimming only to the lines of file that were changed.

florianb commented 7 years ago

Hi @orgkhnargh - thank you for filing that request. The current implementation of trim_trailing_whitespace is standard-conform. If you would like to see an enhancement of the rule i would like to suggest you opening an issue in the editorconfig-standard.

dmytrokyrychuk commented 7 years ago

@florianb, thank you for your suggestiom. I found a similar issue there: editorconfig/editorconfig#208. Unfortunately, there were no updates for over a year, so I guess not many people need this feature.

I've managed to implement a proof of concept of this feature myself using built-in GitRepository API. I'd be happy to make a PR once this feature would not be considered non-standard-conform, or once this project would be willing to accept Atom-specific improvements. For now I'll just use my own fork of this package, where this feature is implemented.

florianb commented 7 years ago

👏 I am sorry i wasn't able to help better..