-
Hello all, I am the developer of bashly, a bash script CLI generator / framework thingy. The generated scripts pass shfmt with almost flying colors, except two format suggestions, that seem wrong to me:
Here is the simplest test case: # test.sh
#!/usr/bin/env bash
action=download
case $action in
-*)
;;
upload)
# This upload section is being messed up with a weird backslash
# Curiously, if this comment will be ABOVE the upload, the backslash
# issue will not happen.
echo "download"
;;
# This comment is ok (not moving)
download | d)
echo "download"
;;
# This comment should not move
"")
echo "download"
;;
esac and running this:
yields this: case $action in
- -*)
- ;;
+ -*) ;;
- upload)
+ \
+ upload)
# This upload section is being messed up with a weird backslash
# Curiously, if this comment will be ABOVE the upload, the backslash
# issue will not happen.
echo "download"
;;
- # This comment should not move
+ # This comment should not move
"")
echo "download"
;; where I expected it to not suggest any of the changes it did (except maybe the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hello, and thanks for raising this! Your two bugs seem valid, and I think they are very similar to #779 and #917. I'll add your examples there, for the sake of avoiding near-duplicates, and take a look when I can. |
Beta Was this translation helpful? Give feedback.
Hello, and thanks for raising this!
Your two bugs seem valid, and I think they are very similar to #779 and #917. I'll add your examples there, for the sake of avoiding near-duplicates, and take a look when I can.