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

fix(parsers): correctly indent keys longer than 1024 chars #4294

Merged
merged 3 commits into from
Mar 30, 2022

Conversation

elado
Copy link
Contributor

@elado elado commented Mar 29, 2022

What's the problem this PR addresses?

Followup on #4275
This PR fixes a missing indentation after a long key.

The bug isn't likely to happen in yarn because it's unlikely to have nested long keys, but it's good to fix anyway.

How did you fix it?
Added missing recordIndentation after they key, before the :

Input:

{[longKey]: {bar: `true`, baz: `quux`}}

Output:

? long-key
:
  bar: true
  baz: quux

Input:

{[longKey]: {[longKey]: {aa: `quux`, [longKey]: `zip`}, baz: `zax`}}

Output:

? long-key
:
  ? long-key
  :
    aa: quux
    ? long-key
    : zip
  baz: zax

...

Checklist

  • I have set the packages that need to be released for my changes to be effective.
  • I will check that all automated PR checks pass before the PR gets reviewed.

@trivikr
Copy link
Contributor

trivikr commented Mar 30, 2022

In the title, the : is missing after fix(parsers)

@elado elado changed the title fix(parsers) correctly indent keys longer than 1024 chars fix(parsers): correctly indent keys longer than 1024 chars Mar 30, 2022
@merceyz merceyz enabled auto-merge (squash) March 30, 2022 07:55
Copy link
Member

@merceyz merceyz left a comment

Choose a reason for hiding this comment

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

Thanks!

@merceyz merceyz merged commit c6f8449 into yarnpkg:master Mar 30, 2022
merceyz added a commit that referenced this pull request May 12, 2022
* fix(parsers) correctly indent keys longer than 1024 chars

* yarn version check

* chore: versions

Co-authored-by: merceyz <[email protected]>
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.

3 participants