big-list-of-naughty-strings icon indicating copy to clipboard operation
big-list-of-naughty-strings copied to clipboard

Remove trailing spaces from blns.json

Open d-frey opened this issue 7 years ago • 4 comments

I'd like to test that a round-trip for my JSON library does not produce any deviation. I have a pretty printer where I can adjust the indention. The problem I have comparing the result of the round-trip with the original blns.json is the trailing spaces at the end of (almost) each line. I don't think they serve any purpose and it would make it easier for me and hopefully others as well if they could be removed.

d-frey avatar Jan 25 '17 21:01 d-frey

Wire up your script to remove them?

letsjustfixit avatar Apr 24 '17 06:04 letsjustfixit

A script to remove them... when they are meant to be tough to parse. I fail to see how this is a good idea. And I don't see any reason for those spaces to exist in the first place, so please fix the root of the problem. It doesn't scale if multiple users are going through the same troubles and might introduce additional bugs by screwing up their scripts.

d-frey avatar May 19 '17 20:05 d-frey

If trailing spaces can potentially screw up scripts, then that sounds more like a good argument to intentionally include them!

scribblemaniac avatar May 19 '17 22:05 scribblemaniac

@scribblemaniac Not if they break tests in ways that cause cases to silently go un-tested.

When testing, you want your tests to work and your project to break, not the other way around.

It should be as easy as possible to ensure you're getting exactly the whitespace the string's author intended and not having the parser strip trailing whitespace from a string where it's part of the test or leave trailing whitespace in a string where it prevents it from triggering a bug.

ssokolow avatar May 19 '17 23:05 ssokolow