GitCC checks commit messages for certain rules.
To use as a GitHub Actions refer to the commit-check-python
section in example.
To expand gitcc to apply your own rules inherit from gitcc.commit_validator.Validator.
If you use the --validator-file
argument the Validator class in that file must be named Validator
.
- gitcc.validation.SimpleTag
- Format:
[<tag>] <Good Description>
(e.g.[ci] Fix testing suite installation
)
gitcc [-h] [-v] [--validator | --validator-file] {message, git-hook, commit, history, branch}
- --validator <Python import path>
Python import path to Validator class. Example:
--validator gitcc.validation.SimpleTag
- --validator-file <file path>
Path to file with Validator.. Example:
--validator-file my_validator.py
- message <text>
check the given message
- text
text to check
- git-hook [--force] <action> <hooks> [<hooks> ...] <repository>
install or uninstall a git hook
- <action>
Install or uninstall. [install, uninstall]
- <hooks>
Choose available hooks. [message]
- <repository>
path to the repository
- [options]
- --force
Force install or uninstall, this might override existing files!
- commit <repository>
check current commit
- <repository>
path to the repository
- history [--sha <SHA>] [--verbose] <repository>
check the current branch history
- <repository>
path to the repository
- [options]
- --sha <SHA>
check until this commit (exclusive)
- --verbose
print correct commits too
- branch [--verbose] <target> <repository>
check the current branch with an other branch common ancestor. Is the same as gitcc history with git merge-base <source> <target>
- <target>
target branch
- <repository>
path to the repository
- [options]
- --verbose
print correct commits too
- -h, --help
show this help message and exit
- -v, --version
show program's version number and exit
gitcc --validator gitcc.validation.SimpleTag message "Is this a valid message?"
https://github.com/IceflowRE/gitcc
- Developer
- GitPython
- Michael Trier and contributors
- https://github.com/gitpython-developers/GitPython
- BSD-3-Clause
Copyright 2021-present Iceflower S ([email protected])
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.