Package: comlipy
comlipy by slashplus - lint commit messages with pythonDemo generated withsvg-term-clicomlipyis a helper that makes it incredibly easy to check whether
your commit messages follow predefined or custom commit message
standards or not.This means that after setting upcomlipyin combination with
a custom gitcommit-msghook (further information),comlipytakes care of the provided commit msg and warns you
whenever a message does not fit your style.By defaultcomlipyfollows theconventional commit standards,
but you can easily change the configuration in order to fit your needs.Requirementspython 3.7+pip (pip3) or brewpoetryInstallationInstallation with brew (recommended)# Add the sourcebrewtapslashplus/comlipygit@gitlab.com:slashplus-build/comlipy.git# Install comlipybrewinstallcomlipyInstallation with pippip3installcomlipyDevelopment installationInstall the repository by git cloning it and by setting up a
virtual environment using poetry:gitclonegit@gitlab.com:slashplus-build/comlipy.git# clone repocdcomlipy/# change to comlipy directorypoetryinstall# install dependenciesRun comlipy:poetryshell# open the virtual environment# or just run a single command# poetry run comlipy-installUsageSetting up a git commit-msg hook (optional)Comlipy comes with a simple git commit-msg hook installer.
This sets up a commit-msg hook that checks the commit message before the
actual commit.An examplecommit-msghook can be foundhereMake sure you have initializedgitin your project.
And then just runcomlipy-install, orcomlipy-install -c 'PATH/TO/CUSTOM/CONFIGFILE.yml'if you want to set a default config override.Note:Don't worry, the installer willnotautomatically override an
existing commit-msg hook. In case such file already exists, you will be
asked if you want to override it.Tip:Sometimes it can be useful to to set up a custom git hooks path, instead
of overriding the commit-msg hook directly.Learn more about ithere.Setting up a a custom configuration override (optional)Its on you to configurecomlipyso it perfectly fits your needs
by setting up and passing a custom configuration yml file. By doing this,
you can override the default configuration i.e. enable or disable rules
or changing the message behaviour (none, warning, error).Seedocsfor further details.DocumentationDocumentation is currently not finished. Following a list of available
references:docs: ALL documentsrules: Reference of all available
validation rules with configuration valuesignores: Reference of default
validation ignores and how to add custom ignorescommit-msg sample hook: Example gitcommit-msghookcli: List of available cli flagsConfigurationIt is possible to change the configuration values. This way you are able
to change rule behaviour of all rules by providing values
forapplicable,value,levelor you can change global settings
i.e. the help message.Therefore you must define a custom YAML file with the rules to override
and pass the custom config file path via parameter:If a config rule is not set, the default value will be used instead.Exampleconfig-comlipy.yml## global definitionsglobal:help:'gethelphere:foo-bar-baz.abc'rules:header-min-length:applicable:'always'value:0level:1header-max-length:applicable:'always'value:123level:2scope-case:value:'upper-case'scope-empty:applicable:'never'level:2ignores:-'^SKIPME'#skip validations where header starts with "SKIPME"TestsYou can run unit.tests by following the python 3 unittest documentation.
For example:python-munittestcomlipy.tests.lib.test_ensure
python-munittestcomlipy.tests.lib.test_rule_checkeror run all tests in batch:# optionally run it in verbose mode (-v)python-munittest-vcomlipy.tests.suiteCredits & inspirationcommitlintconventional commit standards