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

Rule block-sequence-hyphen-indicator-newline #243

Open
Sweetchuck opened this issue Jun 6, 2023 · 1 comment
Open

Rule block-sequence-hyphen-indicator-newline #243

Sweetchuck opened this issue Jun 6, 2023 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@Sweetchuck
Copy link

My expected style is the following:

  • indent every key
  • every key should be in a new line

Good

a: 'foo'
b: 42
c:
  d: 'bar'
e:
  - 'ab'
  - 'cd'
f:
  - 'scalar'
  -
    key1: 'scalar'

Bad

f:
  - 'scalar'
  - key1: 'scalar'

I don't like this one, because in the key path f:1:key1 the 1:key1 part is in the same line.
It can be even more confusing when it contains a null value.

f:
  - 'scalar'
  - key1:
  - 'scalar'

I couldn't achieve this with the currently available settings: yml/block-sequence-hyphen-indicator-newline

@ota-meshi
Copy link
Owner

Thank you for posting the issue.
I think maybe adding a new option like nestedHyphen would be good. However, I think we also need to consider how to behave when using the ? indicator and when using {}.
Also, please consider submitting a pull request to add the option.

@ota-meshi ota-meshi added enhancement New feature or request help wanted Extra attention is needed labels Jun 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants