This repository contains shared repository Git hooks for shell scripts in
githooks/*
to be used with the
Githooks Manager.
The following is included:
- Hook to format markdown files with
prettier
(pre-commit). Will change in the future toremark
. - Scripts for linting/formatting.
Table of Content (click to expand)
Run them
containerized
where only docker
is required.
If you want to run them non-containerized, make the following installed on your system:
This works with Windows setups too.
The hooks can be used by simply using this repository as a shared hook repository inside shell projects. See further documentation.
You should configure the shared hook repository in your project to use this
repos main
branch by using the following .githooks/.shared.yaml
:
version: 1
urls:
- https://github.com/gabyx/githooks-docs.git@main`.
Formatting with prettier
.
The following scripts are provided:
format-docs-all.sh
: Script to format all doc files in a directory recursively. See documentation.
They can be used in scripts by doing the following trick inside a repo which uses this hook:
shellHooks=$(git hooks shared root ns:githooks-docs)
"$shellHooks/githooks/scripts/<script-name>.sh"
The containerized tests in tests/*
are executed by
tests/test.sh
or only special tests steps by
tests/test.sh --seq 001..010
For showing the output also in case of success use:
tests/test.sh --show-output [other-args]