-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Please don't create ending whitespace #13
Comments
Do you have an example of an .yml file with trailing whitespace? If I'm right, trailing whitespaces are only added by the YAML library if the value of a key is empty. Example with no empty value (and no trailing spaces):
Example with empty value (and trailing space):
As you can see, there is a trailing space after "a:" I don't know why the YAML library do that, and, of course, that's something we could manage to remove within the translation gem. But isn't it something that we should leave the YAML library deal with? |
Yes, this only happens with empty keys. Hmm.. sounds like I should report this to the YAML library instead. |
Since you're not the first one to make that observation about the trailing whitespace, I already tried to do that but I don't know exactly where to report it. Is it on: or
After wandering around on the repositories, I found out that this issue is already reported on libYAML: yaml/libyaml#46 |
The "translation:sync" task syncs up the translations, but uses the usual YAML writer, which writes out trailing whitespace. It should not do that, and the trailing whitespace causes later failures in testing. Problem already reported: - translation/rails#13 - yaml/libyaml#46 For now, we'll run this enhancement to solve the problem. Signed-off-by: David A. Wheeler <dwheeler@dwheeler.com>
Thanks, great info. Okay, I've solved it for us by adding this to our "lib/tasks/default.rake" - you might find it useful to document this.
|
It's finally fixed here: 46ec27b And part of 1.19: https://github.com/translation/rails/releases/tag/v1.19 |
Yay! Thanks! |
By policy our project doesn't allow files with whitespace errors, as determined by "git diff --check".
Unfortunately, "sync" creates .yml files with trailing whitespace. It's possible to fix it, but it's a pain, and I suspect many projects have this rule.
Could sync stop creating trailing whitespace?
Thanks so much! I only just started, but this does look like an interesting service.
FYI, here's the documentation from git diff --check:
The text was updated successfully, but these errors were encountered: