Skip to content

[Question]: Apply global indentation rules #355

Open
@efd6

Description

@efd6

Say I have an input like

root1:
 - element1
 - element2
root2:
     - element3
root3:
- element4

and I want to canonicalise the indentation to some defined standard, say

root1:
  - element1
  - element2
root2:
  - element3
root3:
  - element4

How would I go about doing that? I've tried walking over the AST and setting each node's token's column to its indentlevel*2+1 (for the case here) and that almost works, but does not correctly handle the root* indentation positions (resulting in both ugliness and broken yaml).

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions