Skip to content
JonathanTSilvaPublic

About

➕ Standardize the scripting environment to improve the maintainability, readability and efficiency of your scripts

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

79 Commits

Folders and files

Repository files navigation

scriptize: Standardize the scripting environment to improve the maintainability, readability and efficiency of your scripts

Status CI Coverage Quality Scorecard License Codespaces

What it is

scriptize is a set of templates and utilities for Bash and Python scripts, plus a new-script helper that scaffolds a new script from them. The Bash utilities come with shdoc generated API docs and bats tests.

Quick start

Install the tools the Bash templates and tests use.

On Debian/Ubuntu:

sudo apt update
sudo apt install shellcheck bats shell-format

On Fedora:

sudo dnf install ShellCheck bats shfmt

On macOS (using Homebrew):

brew install shellcheck bats shfmt

Then clone the repository and run the installer:

git clone https://github.com/JonathanTSilva/scriptize.git script-templates
cd script-templates && sudo ./install.sh

Usage

Create a new script:

  • new-script bash my-awesome-tool creates ./my-awesome-tool.sh, makes it executable, and you are ready to add your logic.
  • new-script python my-data-processor creates ./my-data-processor.py for your Python project.

Pre-commit hooks

If you keep .pre-commit-config.yaml, install pre-commit once per system and the hooks into your git repo (run inside the repo):

pip install pre-commit
pre-commit install

Generating Bash docs

Run shdoc from the root of your repository without any installation. It behaves like the original shdoc.

Generate documentation for a single file:

./scriptize/utils/shdoc < ./bash/utilities/alerts.bash > docs/alerts_api.md

Generate a single documentation file for all utilities:

./scriptize/utils/shdoc < ./bash/utilities/*.bash > docs/BASH_API_REFERENCE.md

Docs

Contributing

Read the contribution guide first. To work on the Python code:

uv sync
uv run pytest

The Bash utilities are tested with bats, see .github/workflows/shell.yml for how the tests are staged.

License

MIT

jontobias.com

About

➕ Standardize the scripting environment to improve the maintainability, readability and efficiency of your scripts

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages