Skip to content

eviweb/qa-tools

Repository files navigation

Quality Tools

CI

This package provides a set of tools to ensure a level of quality and productivity adapted to the current state of the art in development.

Install

Run the ./install.sh command.
By default it configures globally Git to use the Git Hooks feature.
By using the -t flag, it configures globally Git to use the Git Templates feature.

Please note that:

  • both Git Hooks and Git Templates features are mutually exclusive.
  • already existing Git configuration are saved in order to be restored during uninstallation.

Dependencies

  • libgit2 — required by cocogitto. The install script detects its presence and offers to install it automatically (pkg on Termux, apt-get on Debian/Ubuntu) or prints instructions for other systems.

Uninstall

Run ./install.sh -u.

Features

Git Hooks

All 28 git-documented hooks are registered globally via a dispatcher configured through core.hooksPath.

commit-msg

The commit-msg hook:

  • ensures that the committed message follows the Conventional Commits specification.
  • ensures that the committed message is enhanced by an icon corresponding to its type.

    Please refer to the [commit_type_icons] section of the config.toml file to see or change icons.

  • allows a bunch of additional types.

    Please refer to the [commit_types] section of the cog.toml file to see or change these additional types.

Additional types and icons were grandly inspired by the work of Danny FRITZ (@dannyfritz) and Danny (@its-danny).

To disable commit message validation for a specific repository (e.g. when working with a legacy commit style), set the repo-scoped git config:

git config hook.legacyCommitMessage true

Alternatively, set the environment variable LEGACY_COMMIT_MESSAGE=1 before running git commit.

Per-repository local hooks

Each hook dispatches in order: local beforeglobal handlerlocal after.

Local hooks are placed in .git/hooks/ of the target repository. Two naming formats are accepted and can be combined:

File Runs
<hook>.before or before.<hook> before the global handler
<hook>.after or after.<hook> after the global handler
<hook> (no suffix) after the global handler (default)

Example — run a project linter before the global commit-msg validation:

# .git/hooks/commit-msg.before
#!/usr/bin/env bash
set -euo pipefail
./scripts/lint-commit-msg.sh "$1"
chmod +x .git/hooks/commit-msg.before

No registration needed — the dispatcher picks up local hooks automatically.

See docs/local-hooks.md for the full reference and docs/git-hooks-lifecycle.md for the execution order of all 28 hooks.

Git Templates

For now the templates are the same as the ones provided by Git except for the hooks which are symlinks to this package hooks.
This is a convenient way to keep them in an up to date state.

The integration of this feature relies on the git configuration setting init.templateDir, set globally.

Third party tools and libraries

Please refer to thirdpartylibs.md.

Licence

This project is licensed under the terms of the MIT License.

About

This package provides a set of tools to ensure a level of quality and productivity adapted to the current state of the art in development.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages