Skip to content
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

Add linting for shell scripts and cleanup shell scripts #237

Merged
merged 3 commits into from
May 22, 2016
Merged

Conversation

GUI
Copy link
Member

@GUI GUI commented May 22, 2016

This helps ensure we have valid shell scripts, and follow better shell scripts practices. This helps validate some of the packaging scripts that we don't hit very often and aren't part of our normal test process.

This stems from 10974a9, where I discovered we had a rather obvious syntax error in one of our setup shell scripts. This specific shell scripts only gets run during initial install, so I realized it's easy for us to miss these until we go to actually package and install things (where we do have tests, but those only get run when building new packages). It seemed like some basic shell script checks and linting would be like a good idea to try and catch these basic issues earlier, and also ensure better practices within shell scripts (since it's easy to do things wrong in shell script land).

So this uses shellcheck to perform linting on all our shell scripts. Updates were then made to all our shell scripts to better standardize them and fix any warnings The shellcheck linting will run as part of our normal test process in the CI environment now.

The primary changes involved in cleaning things up:

  • Quote variables to prevent globbing and word splitting.
  • Lower case local variables to distinguish them from environment variables and prevent conflicts.
  • Abstract the perp rc.log files into a single shared file to remove duplicate code.
  • Update package/publish script, that was broken since it was no longer pulling in the version information from the right file.

GUI added 3 commits May 15, 2016 08:02
This helps ensure we have valid shell scripts, and follow better shell
scripts practices. This helps validate some of the packaging scripts
that we don't hit very often and aren't part of our normal test process.

The primary changes involved in cleaning things up:

- Quote variables to prevent globbing and word splitting.
- Lower case local variables to distinguish them from environment
  variables and prevent conflicts.
- Abstract the perp rc.log files into a single shared file to remove
  duplicate code.
- Update package/publish script, that was broken since it was no longer
  pulling in the version information from the right file.
This should ensure we use the same version of shellcheck everywhere
(rather than relying on system installs), and provide an installation
for the CI environment.
@GUI GUI merged commit 9604ba3 into master May 22, 2016
@GUI GUI deleted the shellcheck branch May 22, 2016 14:39
@GUI GUI added this to the v0.12 milestone Jun 26, 2016
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.

1 participant