Skip to content

pretty_generate: don't apply object_nl / array_nl for empty containers #626

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

Merged
merged 1 commit into from
Oct 24, 2024

Conversation

casperisfine
Copy link

Fix: #437

Before:

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

After:

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

NB: I'd rather hold on merging this until 2.7.3 has been released, as I'd like to first do a pure fixes and performance release. This can make it into 2.8.0.

@casperisfine casperisfine force-pushed the pretty-generate-empty-collections branch from f0e0d37 to 66a3e7d Compare October 18, 2024 13:41
@byroot byroot added this to the 2.8 milestone Oct 21, 2024
Fix: ruby#437

Before:

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

After:

```json
{
  "foo": {},
  "bar": []
}
```
@casperisfine casperisfine force-pushed the pretty-generate-empty-collections branch from 66a3e7d to b2c4480 Compare October 24, 2024 09:18
@byroot byroot merged commit 7a8c0b7 into ruby:master Oct 24, 2024
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

support not adding a newline for empty hashes when pretty_generating
2 participants