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

disallowTrailingWhitespace: fix autofix of multiple trailing spaces in a comment #1979

Conversation

lukeapage
Copy link
Contributor

No description provided.

@lukeapage
Copy link
Contributor Author

coveralls still showing wrong coverage: https://coveralls.io/builds/4154949/source?filename=lib%2Fjs-file.js#L865

whole function down as not tested..

@markelog
Copy link
Member

coveralls still showing wrong coverage: https://coveralls.io/builds/4154949/source?filename=lib%2Fjs-file.js#L865

and

"All checks have passed"?

@markelog markelog added the WIP label Nov 17, 2015
@lukeapage
Copy link
Contributor Author

and

"All checks have passed"?

just because the coverage went up, it doesn't mean its not wrong

@markelog
Copy link
Member

Fair enough, i pinged @mdevils about it, as he is maintainer of the unit-coverage tool

@mdevils
Copy link
Member

mdevils commented Nov 19, 2015

Hello @lukeapage. I will soon look into this issue and respond.

@mdevils
Copy link
Member

mdevils commented Nov 19, 2015

According to the idea of unit-coverage, to increase the coverage of token-assert, you need to improve tests of token-assert instead of testing it indirectly.

@lukeapage
Copy link
Contributor Author

lukeapage commented Nov 19, 2015 via email

@markelog
Copy link
Member

You would need to add tests for TokenAssert#noTrailingSpaces method, not to the rule that use it, although having tests for rule is also good

@lukeapage
Copy link
Contributor Author

lukeapage commented Nov 19, 2015 via email

@markelog
Copy link
Member

yeah but at the moment something is in
the wrong place. is it a. the tests or b. the code

Not sure what do you mean by that, if you move tests in other file nothing will change.

its a bit harsh that fixing a bug needs me to refactor one or the other...

Not exactly, if in the future, rule disallowTrailingWhitespace will be removed, TokenAssert#noTrailingSpaces method will be left untested. Or if there will be a bug in the TokenAssert#noTrailingSpaces developer will see rule failure not of the method.

This is more strict testing policy, i give you that, but more maintainable.

@lukeapage
Copy link
Contributor Author

lukeapage commented Nov 19, 2015 via email

@markelog
Copy link
Member

Other rules could use that method, that is why it is in the common place

@lukeapage lukeapage closed this Nov 19, 2015
@lukeapage
Copy link
Contributor Author

no other rule is going to check trailing space on the whole file - that is the rule!!

@markelog
Copy link
Member

We can probably move this logic to the _fix property, note that token-assert module was introduced before the _fix.

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