Package: pygitver
pygitverFeatures:Conventional Commit linterGenerate CHANGELOG and group of CHANGELOGsBump version based on CHANGELOGInstallUse as python CLI (python is required)pipinstallpygitverUse as a docker container (docker engine is required)dockerpullpanpuchkov/pygitverUsers (Developers) SectionInstall Conventional Commit Git Hook CheckerRun in thegitroot folder of the target repository on localhost.dockerrun--rm-v$(pwd):/app-w/app--user"$(id-u):$(id-g)"--entrypoint''panpuchkov/pygitver/pygitver/scripts/install.shIt doesn't matter what the current branch is.You should install it in every repository that needs conventional commit messages.Update pygitverRun in a terminal in any folder:dockerpullpanpuchkov/pygitverGit Conventional Commit LinterYou don't need to use it directly; it will be used automatically on each git commit.Example of a commit message that isNOT VALIDfor Conventional Commits:$gitcommit-am"test"ERROR:CommitdoesnotfitConventionalCommitsrequirementsExample of a commit message that isVALIDfor Conventional Commits:$gitcommit-am"feat: test"[feature/test2af1a5c4]feat:test1filechanged,1deletion(-)Note: repeat this procedure for each repositoryDevOps and Developers SectionExamplesYou may use it as a CLI tool (Python PIP package) or a Docker container.Usage as PIP Package (python is required)Check commit message$pygitver--check-commit-message"feat: conventional commit example"$echo$?0$pygitver--check-commit-message"non-conventional commit example"ERROR:CommitdoesnotfitConventionalCommitsrequirements
MoreaboutConventionalCommits:https://www.conventionalcommits.org/en/v1.0.0/
$echo$?1Get current/next version$gittag-l
v0.0.1
v0.0.2
$pygitver--curr-ver
v0.0.2
$pygitver--next-ver
v0.0.3Generate changelog$pygitverchangelog##########ChangeLog##########Versionv0.0.3=============Features
--------

*Allowtotriggerjobmanually

BugFixes
---------

*Pathforthedefaultchangelogtemplate

*Readme.mdusage

ImprovedDocumentation
----------------------

*Addexamplestothereadme.md

$pygitverchangelog--formatjson|jq.{"version":"v0.0.3","bump_rules":{"major":false,"minor":false,"patch":true},"changelog":{"features":["allow to trigger job manually"],"bugfixes":["path for the default changelog template","README.md usage"],"deprecations":[],"others":[],"docs":["Add examples to the README.md"],"non_conventional_commit":[]}}Usage as Docker container (docker engine is required)$gittag-l
v0.0.1
v0.0.2
$dockerrun--rm-v$(pwd):/app-w/app--user"$(id-u):$(id-g)"panpuchkov/pygitver--curr-ver
v0.0.2
$dockerrun--rm-v$(pwd):/app-w/app--user"$(id-u):$(id-g)"panpuchkov/pygitver--next-ver
v0.0.3
$dockerrun--rm-v$(pwd):/app-w/app--user"$(id-u):$(id-g)"panpuchkov/pygitverchangelog##########ChangeLog##########Versionv0.0.3=============Features
--------

*Allowtotriggerjobmanually

BugFixes
---------

*Pathforthedefaultchangelogtemplate

*Readme.mdusage

ImprovedDocumentation
----------------------

*Addexamplestothereadme.md

$dockerrun--rm-v$(pwd):/app-w/app--user"$(id-u):$(id-g)"panpuchkov/pygitverchangelog--formatjson|jq.{"version":"v0.0.3","bump_rules":{"major":false,"minor":false,"patch":true},"changelog":{"features":["allow to trigger job manually"],"bugfixes":["path for the default changelog template","README.md usage"],"deprecations":[],"others":[],"docs":["Add examples to the README.md"],"non_conventional_commit":[]}}$dockerrun--rm-v$(pwd):/app-w/app--user"$(id-u):$(id-g)"panpuchkov/pygitver--help
usage:pygitver.py[-h][-v][-cv][-nv][-t][-ccmCHECK_COMMIT_MESSAGE]{changelog,changelogs}...

pygitvertool,ver:0.1.2

options:-h,--helpshowthishelpmessageandexit-v,--versionshowtoolversion-cv,--curr-vergetcurrentversion(lastgittag)-nv,--next-vergetnextversion(bumplastgittag)-t,--tagsgittags-ccmCHECK_COMMIT_MESSAGE,--check-commit-messageCHECK_COMMIT_MESSAGEcheckifthegitcommitmessageisvalidforConventionalCommits

Getchangelog:{changelog,changelogs}GetchangeloginTEXTorJSONformatCustom CHANGELOG TemplatesTake as an example:./src/pygitver/templates/changelog.tmplPlace somewhere in your project custom templateSend environment variablePYGITVER_TEMPLATE_CHANGELOGto docker
on run with full template path in Docker (usually/app/...)Conventional Commits RulesThe tool supports simplified Conventional Commits, which are described in this section.The commit message should be structured as follows:<type>[optionalscope]:<description>The commit contains the following structural elements to communicate intent to the consumers of your library:fix:a commit of the type fix patches a bug in your codebase (this correlates withPATCHin Semantic Versioning).feat:a commit of the type feat introduces a new feature to the codebase (this correlates withMINORin Semantic Versioning).BREAKING CHANGE:a commit that has a footerBREAKING CHANGE:, or appends a!after the type/scope, introduces a breaking API change (correlating withMAJORin Semantic Versioning). A BREAKING CHANGE can be part of commits of any type.Other allowed prefixes:build:,chore:,ci:,docs:,style:,refactor:,perf:,test:. These correlate withPATCHin Semantic Versioning.Conventional Commits Examples:Commit without scope without breaking change.fix: crash on wrong input dataCommit message with ! to draw attention to breaking change.feat!: send an email to the customer when a product is shippedCommit message with scope and ! to draw attention to breaking change.feat(api)!: send an email to the customer when a product is shippedCommit message with scope.feat(lang): add Polish languageDevelopmentBuild Dockerdockerbuild-tpygitver.Install to Localhostpipinstall-rrequirements-dev.txtTest on LocalhostRun all checkstoxA single file of the test runtox-ecoverage--./tests/test_git.py-vvorcoveragerun-mpytest--./tests/test_git.pyBuild pip packageLinuxpython-mbuildForDebianbased OS:DEB_PYTHON_INSTALL_LAYOUT=deb_systempython3-mbuild