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

Request: indent being respected beyond top level #142

Open
jamesbraza opened this issue Oct 2, 2023 · 1 comment
Open

Request: indent being respected beyond top level #142

jamesbraza opened this issue Oct 2, 2023 · 1 comment
Labels
yaml_v3_problem A bug in the underlying yaml library. These issues are vastly harder to fix.

Comments

@jamesbraza
Copy link
Contributor

The below:

repos:
    - repo: https://github.com/pre-commit/pre-commit-hooks
      rev: v4.4.0
      hooks:
          - id: check-byte-order-marker
          - id: check-docstring-first
          - id: requirements-txt-fixer
            description: >-
                Sorts entries in requirements.txt and removes incorrect entry
                for `pkg-resources==0.0.0`.

With -formatter=indent=4,scan_folded_as_literal=true being passed to yamlfmt gets corrected to:

repos:
    - repo: https://github.com/pre-commit/pre-commit-hooks
      rev: v4.4.0
      hooks:
        - id: check-byte-order-marker
        - id: check-docstring-first
        - id: requirements-txt-fixer
          description: >-
            Sorts entries in requirements.txt and removes incorrect entry
            for `pkg-resources==0.0.0`.

We can see the top level 4-space indent was preserved, but not the nested levels beyond that.

Can we make indent be recursive?

@braydonk
Copy link
Collaborator

braydonk commented Oct 2, 2023

The bug appears to be specifically with nested arrays. I will try and find time to fix it.

@braydonk braydonk added the yaml_v3_problem A bug in the underlying yaml library. These issues are vastly harder to fix. label Oct 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
yaml_v3_problem A bug in the underlying yaml library. These issues are vastly harder to fix.
Projects
None yet
Development

No branches or pull requests

2 participants