-
Notifications
You must be signed in to change notification settings - Fork 174
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
[Travis CI] use "ShellCheck" to validate the shell scripts in xCAT commits #4610
Comments
👍 Good to see the action that we are looking for the ways to improve ourselves. |
@immarvin, thanks for your information. It is very helpful for test. |
Packages for shellcheck are also available for |
@immarvin @hu-weihua A lot of the scripts are expected to run on very diverse systems. For those systems that provide bash, it may be good to create a matrix of expected bash versions against the base systems as a lot of shell features are introduced by newer major Bash versions. In this particular case, I see a script that expects to work on both AIX and linux. However I am unsure of what bash version is available on AIX, which means that I cannot make changes to it because I might be introducing gotchas depending on the version of bash available on AIX. |
hi @samveen , thanks for the explanation. So I think you do not need to consider AIX support while modifying the postscripts unless:
For the scripts that are run with |
@immarvin For any scripts with AIX specific code paths inside common scripts will still need non-bash specific code in the common areas. This makes the script syntax fixes a lot harder. On a side note, Is AIX still supported, and how long will it remain as a supported system? |
hi @samveen , checked this with team, for xCAT releases after 2.12, we do not announce support for AIX any longer |
Can I safely expect |
hi @samveen , sles11.4 is still in the support list of xCAT 2.13.x and sles11.4 ships bash 3.x |
@immarvin I am working on |
Due to xCAT team will use IBM internal github to manage task. the related task is https://github.ibm.com/xcat2/task_management/issues/177. |
@samveen Is your plan to go through all xCAT scripts and make them pass |
@gurevichmark Yes, I was planning on getting as much of the shell portion of the project shellchecked as possible. |
ShellCheck
is a GPLv3 tool that gives warnings and suggestions for bash/sh shell scripts, we can leverage it to impose a strict check on the shell scripts in xCATFrom https://github.com/koalaman/shellcheck:
The goals of ShellCheck are
To point out and clarify typical beginner's syntax issues that cause a shell to give cryptic error messages.
To point out and clarify typical intermediate level semantic problems that cause a shell to behave strangely and counter-intuitively.
To point out subtle caveats, corner cases and pitfalls that may cause an advanced user's otherwise working script to fail under future circumstances.
Travis CI Setup
If you want to use ShellCheck in Travis CI, you can most easily install it via apt:
The text was updated successfully, but these errors were encountered: