-
Notifications
You must be signed in to change notification settings - Fork 0
Pipelines
The template has two pipelines:
- Continuous integration (CI): it is responsible for running the quality metrics in the code of a pull request, when it is created or updated, and also in the code of the main branch of the project, when it is updated or once a week by a schedule routine.
- Continuous Delivery (CD): it is responsible for updating the project documentation, when the code of the main branch is updated.
The idea of having them is both to assure the quality of the code delivered, but also to remember each (minimal) step a developer has to fullfil to make their code able to be merge into the main branch.
Through pre-commit, when creating a commit (i.e. when running git commit
), some of the quality metrics are run locally. This can prevent unnecessary runs of the CI pipeline. It is also possible to disable pre-commit run in a specific commit, you just need to pass the flag -n
(alias for --no-verify
) to the git commit
command.
Being a Python library, does not mean that pre-commit is just for Python projects. It's configuration is through the .pre-commit-config.yaml
file, so no need to write Python code with it. It also has some implemented hooks to different languages.
Through gitlint, all commit messages of the main branch(except the first one) and all commits to secondary branches are checked if they follow the Conventional Commits specification.
You can also use this Python library without writting Python code. It's configuration is through the .gitlint
file.
It is also possible to create your own commit message rule with gitlint, by writing it as a Python regex. In your .gitlint
file, add for example
[title-match-regex]
regex=^\[#\d+\] (fix|feat|docs|refactor): \w(\w+ ?){5,}$