Skip to content
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

support not adding a newline for empty hashes when pretty_generating #437

Open
fawaf opened this issue Jul 9, 2020 · 1 comment · May be fixed by #626
Open

support not adding a newline for empty hashes when pretty_generating #437

fawaf opened this issue Jul 9, 2020 · 1 comment · May be fixed by #626
Milestone

Comments

@fawaf
Copy link

fawaf commented Jul 9, 2020

currently, pretty_generate will add a newline to the output if there is a hash or array that is empty:

{
  "blah":"bar",
  "foo": {
  },
  "baz": [
  ]
}

this is to add an optional argument to not generate that newline. e.g.

{
  "blah":"bar",
  "foo": {},
  "baz": []
}
@byroot
Copy link
Member

byroot commented Oct 18, 2024

I'm thinking this should just the the default to be honest.

casperisfine pushed a commit to casperisfine/json that referenced this issue Oct 18, 2024
Fix: ruby#437

Before:

```json
{
  "foo": {
  },
  "bar": [
  ]
}
```

After:

```json
{
  "foo": {},
  "bar": []
}
```
casperisfine pushed a commit to casperisfine/json that referenced this issue Oct 18, 2024
Fix: ruby#437

Before:

```json
{
  "foo": {
  },
  "bar": [
  ]
}
```

After:

```json
{
  "foo": {},
  "bar": []
}
```
@byroot byroot added this to the 2.8 milestone Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants