Skip to content

Example codespace for bash programming, includes bats, shellcheck, shfmt

License

Notifications You must be signed in to change notification settings

jhomer-hscl/example-bash-codespace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

example-bash-codespace

Overview

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.

Dependencies

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

Example Scripts

example-bad

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.

example-good

This is the fixedimproved version that addresses:

  • Problems identified with shellcheck.
  • Basic error handling where required to get sensible behaviour.
  • Lack of unit tests

Using

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

Contributing

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.

About

Example codespace for bash programming, includes bats, shellcheck, shfmt

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages