openrewrite / rewrite

Automated mass refactoring of source code.
https://docs.openrewrite.org
Apache License 2.0
2.03k stars 300 forks source link

Issue discovered with `.circleci/config.yml` #1135

Closed zieka closed 2 years ago

zieka commented 2 years ago

Problem

Invalid indentation of yaml

Expected behavior

expected the after result to have the same indentation level as the first list item

Example diff

     working_directory: ~/repo
     steps:
       - checkout
-      - run:
-          name: Install dependencies
-          command: npm ci
-      - run:
-          name: Run tests
-          command: npm run test:ci
+       - run:
+           name: Install dependencies
+           command: npm ci
+         - run:
+             name: Run tests
+             command: npm run test:ci

   'node-12':
     docker:
     working_directory: ~/repo
     steps:
       - checkout
-      - run:
-          name: Install dependencies
-          command: npm ci
-      - run:
-          name: Run tests
-          command: npm run test:ci
+       - run:
+           name: Install dependencies
+           command: npm ci
+         - run:
+             name: Run tests
+             command: npm run test:ci

 workflows:
   version: 2.1
   build:
     jobs:
       - 'node-10'
-      - 'node-12'
+       - 'node-12'

Recipes in example diff:

References:

pway99 commented 2 years ago

Issue has been resolved, have enabled associated test 742c91c4e6bb952a0c4a0a8d61fe1c7cfb0b7ced