Skip to content

syntax: regression in indenting code after test expression #628

@fauust

Description

@fauust

Hi!
First of all, this is a great tool that I use everyday in my workflow so, bravo!

I have noticed in my CI system a change with latest docker image, see bellow:

❯ docker run -it -v $(pwd):/mnt mvdan/shfmt:v3.1.2 -d -i 2 -ci /mnt/ci/run.sh
--> OK (no changes)
❯ docker run -it -v $(pwd):/mnt mvdan/shfmt:latest -d -i 2 -ci /mnt/ci/run.sh
--- /mnt/ci/run.sh.orig
+++ /mnt/ci/run.sh
@@ -62,13 +62,13 @@
     echo "No new roles modification to test in CI"
     exit 0
   fi
-fi
+  fi

-echo -e "Molecule CI tests are going to be executed on:\n$ROLES\n---"
+  echo -e "Molecule CI tests are going to be executed on:\n$ROLES\n---"

-# molecule test
-for R in $ROLES; do
-  cd "$R" || err "cd $R"
-  molecule test || err "$R"
-  cd ../..
-done
+  # molecule test
+  for R in $ROLES; do
+    cd "$R" || err "cd $R"
+    molecule test || err "$R"
+    cd ../..
+  done

Here is the full script https://paste.debian.net/1169744/

Comparing the diff between 2 versions, I can't find any reason for this changes. Also, locally the behavior looks good:

./shfmt_v3.1.2_linux_amd64 --version
v3.1.2./shfmt_v3.1.2_linux_amd64 -d -i 2 -ci ci/run.sh
--> OK (no changes)./shfmt_v3.2.0_linux_amd64 --version
v3.2.0./shfmt_v3.2.0_linux_amd64 -d -i 2 -ci ci/run.sh
--> OK (no changes)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions