Skip to content

Add formatting option for trailing comma#1123

Merged
datho7561 merged 1 commit intoredhat-developer:mainfrom
datho7561:trailing-comma-option
May 13, 2025
Merged

Add formatting option for trailing comma#1123
datho7561 merged 1 commit intoredhat-developer:mainfrom
datho7561:trailing-comma-option

Conversation

@datho7561
Copy link
Copy Markdown
Contributor

What does this PR do?

Adds an option yaml.format.trailingComma to set if trailing commas should be used JSON-style blocks like this:

{
  key: 'value',
  food: 'raisins',
  airport: 'YYZ',
  lightened_bulb: 'illuminating',
}

See redhat-developer/yaml-language-server#1063, this PR requires that PR in order to work.

What issues does this PR fix or reference?

Fixes #1112

Is it tested? How?

Unit tests in yaml-language-server. I can look into integration tests here if you think it's helpful.

@datho7561
Copy link
Copy Markdown
Contributor Author

@msivasubramaniaan let me know if I should merge this. This is the setting that's needed to use redhat-developer/yaml-language-server#1063

Copy link
Copy Markdown
Contributor

@msivasubramaniaan msivasubramaniaan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@datho7561 datho7561 force-pushed the trailing-comma-option branch from a4809ee to d763fdd Compare May 12, 2025 14:42
See redhat-developer/yaml-language-server#1063, this PR requires that
PR in order to work.

Fixes redhat-developer#1112

Signed-off-by: David Thompson <davthomp@redhat.com>
@datho7561 datho7561 force-pushed the trailing-comma-option branch from d763fdd to 3190c8d Compare May 12, 2025 14:43
Copy link
Copy Markdown
Contributor

@msivasubramaniaan msivasubramaniaan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@datho7561 datho7561 merged commit cc15df6 into redhat-developer:main May 13, 2025
4 of 6 checks passed
@datho7561 datho7561 deleted the trailing-comma-option branch May 13, 2025 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove Trailing Comma

2 participants