Skip to content

Conversation

@shri314
Copy link

@shri314 shri314 commented Jul 11, 2017

https://travis-ci.org/shri314/beautify_bash/jobs/252237202.

Additional contributions from cheako/beautify_bash

shri314 and others added 30 commits January 12, 2017 08:55
   ...
   if [ $? == 0 ]
   then
                     cat <<EOM
                     abc
                     EOMFAKE
                     EOM
   EOM
   fi
   ...

will be indented as

   ...
   if [ $? == 0 ]
   then
      cat <<EOM
                     abc
                     EOMFAKE
                     EOM
EOM
   fi
   ...
  - Restructured the if conditions using "continue" instead of complex if-else ladder - (at the risk of a few unknown regressions)
  - Remove in_here_doc flag, instead directly depend on here_string
  - Remove in_ext_quote flag, instead directly depend on ext_quote_string
  - Removed defer_ext_quote flag

   Now:
   func() {
               Y1="This----------
                  this is <<HERE--
                  qu\"otes"---
                  echo------
   }

   Indents as:
   func() {
      Y1="This----------
                  this is <<HERE--
                  qu\"otes"
      echo
   }
   The following:
   func() {
                  echo alpha \
            beta \
               gamma \
                  delata
               echo
                  echo a |
                     grep x |
            grep y |
                  grep p
               echo
                  echo a &&
                     grep x &&
            grep y &&
                  grep p
                  echo
                  echo a ||
                     grep x ||
            grep y ||
                  grep p
                  echo
   }

   Will indent as below:
   func() {
      echo alpha \
         beta \
         gamma \
         delata
      echo
      echo a |
         grep x |
         grep y |
         grep p
      echo
      echo a &&
         grep x &&
         grep y &&
         grep p
      echo
      echo a ||
         grep x ||
         grep y ||
         grep p
      echo
   }
@shri314 shri314 changed the title Several improvements to bash indentation script + Packaging + Tests integrated via travis Several improvements to bash indentation script + Tests integrated via travis Jul 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants