shipshapecode / ember-cli-release

Ember CLI addon for versioned release management
MIT License
90 stars 18 forks source link

Removes trailing newline in package.json #21

Closed mmun closed 9 years ago

mmun commented 9 years ago

Not that big of a deal, but it would be nice to avoid changing the whitespace, as demonstrated in this commit:

https://github.com/tildeio/htmlbars/commit/a5bb78d179d8126f5c622d00e98ca1e00c0322dc

slindberg commented 9 years ago

The problem is that most editors are configured to add trailing newlines on save, since this is better for git diffs in general. And sometimes you just have to edit package.json with an editor. ¯_(ツ)_/¯

This is one of those things I've just given up on. Software amirite?

mmun commented 9 years ago

@slindberg That's true. npm install --save some-new-dep also renormalizes the package.json to have a newline at the end (among other things). The problem is that ember-cli-release removes the newline, so you're constantly fighting npm & your editor.

I'll try and find how npm install does its normalization.

mmun commented 9 years ago

https://github.com/npm/npm/blob/064d62c2f251cb5e9328f63228f711844b7a1787/lib/install/update-package-json.js#L15

slindberg commented 9 years ago

Ahhh, I understand now. Although for some reason I thought that doing an npm install --save ... stripped the newline. Must have been caused by other dev's editors or something.