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

List indent fixing is broken #202

Open
Cougar opened this issue Apr 14, 2023 · 2 comments
Open

List indent fixing is broken #202

Cougar opened this issue Apr 14, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@Cougar
Copy link

Cougar commented Apr 14, 2023

1️⃣ Description

I have "valid" YAML file with not the best list indents and yamlfixer breaks it

📑 Steps to Reproduce

Steps to reproduce the behavior:

  1. When I have test.yml like this:
---

a:
  b:
  - 1
  - 2
  - 3
  c:
    4
  1. Then run that: yamlfixer --nochange --summary --diffto my.patch test.yml

  2. I get such change:

--- "test.yml"
+++ "test.yml-after"
@@ -2,7 +2,7 @@
 
 a:
   b:
-  - 1
+    - 1
   - 2
   - 3
   c:

2️⃣ Expected behavior

All lines with elements 1, 2 and 3 should be indented with two extra spaces like this:

---

a:
  b:
    - 1
    - 2
    - 3
  c:
    4

Diff should look like this:

--- "test.yml"
+++ "test.yml-after"
@@ -2,8 +2,8 @@
 
 a:
   b:
-  - 1
-  - 2
-  - 3
+    - 1
+    - 2
+    - 3
   c:
     4

# ℹ️ Environment details

 - OS: `openSUSE Leap 15.4`
 - Python runtime: `3.10.10`
 - The output of `yamlfixer --version`: `yamlfixer v0.9.15`
 - Used shell: bash
 
# Additional context

Add any other context about the problem here.
@Cougar Cougar added the bug Something isn't working label Apr 14, 2023
@Cougar
Copy link
Author

Cougar commented Apr 14, 2023

Related with adrienverge/yamllint#427

@cyyeong
Copy link

cyyeong commented Aug 31, 2023

This is still an issue. Will this be fixed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants