Package: pccc
The Python Conventional Commit Checker.Descriptionpccc is a PyParsing based grammar and script for parsing and verifying
a commit message is a conventional commit.  The default grammar
follows thespecification, but
allows for the definition of types in addition tofeatandfixand for the definition of project specific scopes and footers in
compliance with the specification.  The maximum line lengths of the
commit header and commit body and spelling can also be checked.Currently, the script interface will load configuration options and a
commit message and attempt to parse it.  If there are no parse
exceptions, it will return 0, otherwise 1.  This interface should be
usable at the gitcommit-msghook stage now.  It can also be
configured to ignore certain automatically generated commits (fromgit pullfor instance) if it is not desirable or possible to
generate those commits as conventional commits (preferable).Parsing GrammarGithub Closes Issue SyntaxKEYWORD = ‘(close[ds]?|fix(?:es|ed)?|resolve[ds]?)’OWNER = ‘^[a-zA-Z0-9](?:[a-zA-Z0-9]|-(?=[a-zA-Z0-9])){0,38}$’REPOSITORY = ‘^[a-zA-Z0-9](?:[a-zA-Z0-9]|-(?=[a-zA-Z0-9])){0,38}$’ISSUE-NUMBER = ‘#d+’Single issue in same repository:  KEYWORD #ISSUE-NUMBERSingle issue in different repository:  KEYWORD OWNER/REPOSITORY ISSUE-NUMBERMultiple issues: use full syntax for each issueThe parser inpcccrequires separating multiple issues on theGithub-issuesline with “, “.See:https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue/https://github.com/shinn/github-username-regex/InstallationInstall pccc with:pip install pccc
pip freeze > requirements.txtor add as a poetry dev-dependency.If you desire a package locally built with poetry, download the
source, change the appropriate lines inpyproject.toml, and
rebuild.To use as a gitcommit-msghook, copy the scriptpcccto.git/hooks/commit-msgand set the file as executable or integrate
the script or module into your existingcommit-msghook.pcccrelies ongitsetting the current working directory of the script
to the root of the repository (wherepyproject.tomlorpackage.jsontypically lives).  If this is not the repository
default, pass the configuration file path as an argument or symlink
from the current working directory to an appropriate configuration
file.UsageConsole:pccc COMMIT_MSG
cat COMMIT_MSG | pcccIn Python:>>> import pccc
>>> ccr = pccc.ConventionalCommitRunner()
>>> ccr.options.load()
>>> ccr.raw = "some commit message"
>>> ccr.clean()
>>> ccr.parse()
>>> if ccr.exc == None:
...     print(ccr)See the source anddocumentationfor more information.ConfigurationSeepccc.tomlfor an example[tool.pccc]section that may be
copied into apyproject.tomlfile.  The same entries may be used
in apcccentry inpackage.jsonfor JavaScript/TypeScript
projects.Copyright and LicenseSPDX-License-Identifier:GPL-3.0-or-laterpccc, the Python Conventional Commit Checker.
Copyright (C) 2020-2021Jeremy A Gray.This program is free software: you can redistribute it and/or modify
it under the terms of theGNU General Public Licenseas published by the Free
Software Foundation, either version 3 of the License, or (at your
option) any later version.This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
General Public License for more details.You should have received a copy of theGNU General Public Licensealong with this program.
If not, seehttps://www.gnu.org/licenses/.AuthorJeremy A Gray