Example codespace for bash programming, includes bats, shellcheck, shfmt and other useful plugins and configuration for simple projects and demonstrating basic code quality and testing methodologies.
The following dependencies are included as git submodules:
These will need to be initialised in any new codespace or after cloning this repository if --recursive
was not used
git submodule update --init
This is a script with problems and no tests.
It is partially from a real world exampled picked out for a learning / teaching exercise in how to use available code quality tools like shellcheck
and a level of testing for shell scripts using bats
.
This is the fixedimproved version that addresses:
- Problems identified with shellcheck.
- Basic error handling where required to get sensible behaviour.
- Lack of unit tests
Feel free to fork this repository it comes with setup for github codespace and a number of useful plugins for shell scripting with in VSCode.
You should easily be able to look at the VSCode problem reporting, which this is intended to highlight, run the tests, etc. within the free personal allowances.
Alternatively, clone the repo and work locally.
git clone https://github.com/jhomer-hscl/example-bash-codespace.git --recursive
I'm not looking to take contributions via Pull Requests. But feel free raise an issue if there is something glaringly incorrect as opposed could be better.