Skip to content
This repository has been archived by the owner on Mar 23, 2024. It is now read-only.

disallowTrailingWhitespace: fix autofixing CRLF and CR files #1980

Closed
wants to merge 1 commit into from

Conversation

lukeapage
Copy link
Contributor

it would be slightly better if this used the line endings option, but that doesn't autofix yet.

thinking about this and the line endings option, have you thought about/would you accept a pr that instead of altering tokens, added a post output hook to fix ? trailing whitespace and eol would be a doddle to fix post output, instead of all the complications in finding the right token..

@lukeapage
Copy link
Contributor Author

as noted in #1978 I think something isn't set up right with your coverage.

@@ -517,6 +517,7 @@ TokenAssert.prototype.noTokenBefore = function(options) {
TokenAssert.prototype.noTrailingSpaces = function(options) {
var ignoreEmptyLines = options.ignoreEmptyLines;
var lines = this._file.getLines();
var linebreak = this._file.getLineBreaks()[0] || '\n';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you cover this branch: || '\n'?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is already a test without any line breaks in it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you see the coverage saying that isn't tested can you point me at it.

@markelog markelog added the WIP label Nov 17, 2015
@lukeapage lukeapage closed this Nov 19, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants