Add forceformat option #27

Merged
merged 3 commits into from Dec 16, 2012

Conversation

Projects
None yet
2 participants
Contributor

lroggendorff commented Sep 14, 2012

Howdy,

Using jsonlint.com, I got used to the behavior that it goes ahead and formats the source even if errors are found. When I started using the jsonlint cli, I noticed that behavior was missing. It seemed like it might be nice to include, so I thought I'd give it a shot. I've just taken Chris Dary's char-by-char formatter and inserted it. I'm hoping that's cool, or that you and he can work it out one way or the other. :)

Also, while working on this, I noticed a variable name wasn't updated properly in cli.js. That change is included in this PR, or I've also created a branch specifically for that change, so I could send a separate PR if you'd rather.

Cheers,
Lance

lroggendorff added some commits Sep 13, 2012

@lroggendorff lroggendorff Fixing variable name when overwriting input file.
It looks like at one time the variable referencing the input file was
'path', and later on it was changed to 'json', but the if
(options.inplace) block was never updated.
0f32023
@lroggendorff lroggendorff Adding forceformat option: format invalid output just like jsonlint.com
When using jsonlint.com, even invalid JSON is pretty printed. It seemed
like a good option to have in the cli version as well. This is simply
inserting the char-by-char formatter from
https://github.com/umbrae/jsonlintdotcom and adding an option to cli.js.
92ac817
@lroggendorff lroggendorff Merge branch 'fix-inplace-overwriting' into add-forceformat-option
* fix-inplace-overwriting:
  Fixing variable name when overwriting input file.
59c36ad

@zaach zaach added a commit that referenced this pull request Dec 16, 2012

@zaach zaach Merge pull request #27 from lroggendorff/add-forceformat-option
Add forceformat option
79b553f

@zaach zaach merged commit 79b553f into zaach:master Dec 16, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment