├── .dir-locals.el ├── .flake8 ├── .github └── ISSUE_TEMPLATE │ ├── bug-report.md │ └── parse-error.md ├── .gitignore ├── .pre-commit-config.yaml ├── LICENSE ├── LICENSE.rst ├── MANIFEST.in ├── Makefile ├── README.rst ├── bin └── pccc.py ├── docs ├── Makefile ├── classes.rst ├── cli.rst ├── conf.py ├── functions.rst ├── index.rst ├── license.rst ├── make.bat └── readme.rst ├── freeze.sh ├── package.json ├── pccc.toml ├── pccc ├── __init__.py ├── config.py ├── exceptions.py └── parser.py ├── poetry.lock ├── pyproject.toml ├── requirements.txt ├── setup.cfg ├── tests ├── config │ ├── 0001.json │ ├── 0002.json │ ├── 0003.json │ ├── 0004.json │ ├── 0005.json │ ├── 0006.json │ ├── 0007.json │ ├── 0008.json │ ├── 0009.json │ ├── 0010.json │ ├── 0011.json │ ├── 0012.json │ ├── 0013.json │ └── bad.json ├── parser │ ├── 0001.json │ ├── 0002.json │ ├── 0003.json │ ├── 0004.json │ ├── 0005.json │ ├── 0006.json │ ├── 0007.json │ ├── 0008.json │ ├── 0009.json │ ├── 0010.json │ ├── 0011.json │ ├── 0012.json │ ├── 0013.json │ ├── 0014.json │ ├── 0015.json │ ├── 0016.json │ ├── 0017.json │ ├── 0018.json │ ├── 0019.json │ ├── 0020.json │ ├── 0021.json │ ├── 0022.json │ ├── 0023.json │ ├── 0024.json │ ├── 0025.json │ ├── 0026.json │ ├── 0027.json │ ├── 0028.json │ ├── 0029.json │ ├── 0030.json │ ├── 0031.json │ ├── 0032.json │ ├── 0033.json │ ├── 0034.json │ ├── 0035.json │ ├── 0036.json │ ├── 0037.json │ ├── 0038.json │ ├── 0039.json │ ├── 0040.json │ ├── 0041.json │ ├── 0042.json │ ├── 0043.json │ ├── 0044.json │ ├── 0045.json │ ├── 0046.json │ ├── 0048.json │ ├── 0049.json │ ├── 0050.json │ ├── 0051.json │ ├── 0052.json │ ├── 0053.json │ ├── 0054.json │ └── template.json ├── test_config.py ├── test_exceptions.py ├── test_parser.py └── test_spelling.py └── tox.ini /.dir-locals.el: -------------------------------------------------------------------------------- 1 | ;; SPDX-License-Identifier: GPL-3.0-or-later 2 | 3 | ((python-mode 4 | (flycheck-python-flake8-executable . "/home/gray/.virtualenvs/pccc/bin/flake8") 5 | (flycheck-python-pylint-executable . "/home/gray/.virtualenvs/pccc/bin/flake8")) 6 | (rst-mode 7 | (flycheck-rst-sphinx-executable . "/home/gray/.virtualenvs/pccc/bin/sphinx-build"))) 8 | -------------------------------------------------------------------------------- /.flake8: -------------------------------------------------------------------------------- 1 | #*********************************************************************** 2 | # 3 | # pccc, the Python Conventional Commit Checker. 4 | # 5 | # SPDX-License-Identifier: GPL-3.0-or-later 6 | # 7 | # Copyright 2020-2022 Jeremy A Gray . 8 | # 9 | #*********************************************************************** 10 | 11 | [flake8] 12 | 13 | extend-ignore = 14 | E203, 15 | W503 16 | 17 | per-file-ignores = 18 | __init__.py: F401 19 | 20 | exclude = 21 | .git, 22 | .tox, 23 | __pycache__, 24 | 25 | max-complexity = 20 26 | max-line-length = 95 27 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug-report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug Report 3 | about: Report general, non-parsing issues with this template. 4 | title: "[BUG]" 5 | labels: bug 6 | assignees: jeremyagray 7 | 8 | --- 9 | 10 | - [ ] Description: 11 | - [ ] Actual Behavior: 12 | - [ ] Expected Behavior: 13 | - Inputs: 14 | - [ ] Commit Message: "" 15 | - [ ] `[tool.pccc]` section of `pyproject.toml`: "" 16 | - [ ] CLI string: "" 17 | - Software Versions: 18 | - [ ] python: 19 | - [ ] pyparsing: 20 | - [ ] pccc: 21 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/parse-error.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Parse Error 3 | about: Report commit parse errors with this template. 4 | title: "[PARSE ERROR]" 5 | labels: bug 6 | assignees: jeremyagray 7 | 8 | --- 9 | 10 | ### Instructions 11 | 12 | The following list corresponds to the the current data used for testing the parser. Complete as much as possible, but at least the "raw" field and add your configuration options. Several options have pre-filled choices; please select one. All options are either strings or integers, except `body["paragraphs"]` (an array of strings, one per body paragraph) and `footers` (an array of `footer` objects). 13 | 14 | Commit parsing errors will be resolved by integrating submitted data into the parser unit testing and fixing any resulting issues. 15 | 16 | ### Commit Parsing Data 17 | 18 | - raw: "" 19 | - parsed: "" 20 | - header: 21 | - type: "" 22 | - scope: "" 23 | - description: "" 24 | - length: 0 25 | - body: 26 | - paragraphs 27 | - "" 28 | - longest: 0 29 | - breaking: 30 | - flag: true or false 31 | - token: "BREAKING CHANGE" or "BREAKING-CHANGE" or " #" 32 | - separator: ": " or " #" 33 | - value: "" 34 | - footers: 35 | - footer: 36 | - token: "" 37 | - separator: ": " or " #" 38 | - value: "" 39 | 40 | ### Configuration Data 41 | 42 | Add your`[tool.pccc]` section of `pyproject.toml` and/or your CLI arguments used to produce the parsing error. 43 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: GPL-3.0-or-later 2 | 3 | # Emacs. 4 | *~ 5 | 6 | # Python. 7 | *.egg-info 8 | *.pyc 9 | .coverage 10 | .hypothesis/ 11 | .pytest_cache 12 | .python-version 13 | .tox 14 | __pycache__ 15 | build 16 | commit 17 | dist 18 | docs/_build 19 | htmlcov 20 | 21 | # Generated files. 22 | README.html 23 | tests/config/*.toml 24 | tests/parser/*.raw 25 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | # ****************************************************************************** 2 | # 3 | # pccc, the Python Conventional Commit Checker. 4 | # 5 | # Copyright 2020-2022 Jeremy A Gray . 6 | # 7 | # SPDX-License-Identifier: GPL-3.0-or-later 8 | # 9 | # ****************************************************************************** 10 | 11 | --- 12 | repos: 13 | - repo: https://github.com/pre-commit/pre-commit-hooks 14 | rev: v4.4.0 15 | hooks: 16 | - id: trailing-whitespace 17 | - id: end-of-file-fixer 18 | - id: check-yaml 19 | - id: check-added-large-files 20 | 21 | - repo: https://github.com/psf/black 22 | rev: 23.1.0 23 | hooks: 24 | - id: black 25 | language_version: python3 26 | 27 | - repo: https://github.com/PyCQA/flake8 28 | rev: 6.0.0 29 | hooks: 30 | - id: flake8 31 | 32 | - repo: https://github.com/pycqa/isort 33 | rev: 5.12.0 34 | hooks: 35 | - id: isort 36 | 37 | - repo: https://github.com/pycqa/pydocstyle 38 | rev: 6.3.0 39 | hooks: 40 | - id: pydocstyle 41 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | recursive-include docs * 2 | include LICENSE.rst 3 | include README.rst 4 | include pccc.toml 5 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | #*********************************************************************** 2 | # 3 | # pccc, the Python Conventional Commit Checker. 4 | # 5 | # SPDX-License-Identifier: GPL-3.0-or-later 6 | # 7 | # Copyright 2020-2022 Jeremy A Gray . 8 | # 9 | #*********************************************************************** 10 | 11 | python-modules = pccc tests 12 | python-files = 13 | 14 | .PHONY : test-all 15 | test-all: 16 | pytest -vv --cov pccc --cov tests --cov-report term --cov-report html 17 | 18 | .PHONY : build 19 | build : 20 | cd docs && make html 21 | pip install -q build 22 | python -m build 23 | 24 | .PHONY : clean 25 | clean : 26 | rm -rf build 27 | rm -rf dist 28 | rm -rf pccc.egg-info 29 | cd docs && make clean 30 | 31 | .PHONY : dist 32 | dist : clean build 33 | 34 | .PHONY : commit 35 | commit : 36 | pre-commit run --all-files 37 | 38 | .PHONY : lint 39 | lint : 40 | flake8 --exit-zero $(python-modules) $(python-files) 41 | isort --check $(python-modules) $(python-files) || exit 0 42 | black --check $(python-modules) $(python-files) 43 | 44 | .PHONY : lint-fix 45 | lint-fix : 46 | isort $(python-modules) $(python-files) 47 | black $(python-modules) $(python-files) 48 | 49 | .PHONY : pip 50 | pip : 51 | pip install -r requirements.txt 52 | 53 | .PHONY : test 54 | test : 55 | pytest 56 | 57 | .PHONY : upload 58 | upload : 59 | python3 -m twine upload --verbose dist/* 60 | 61 | .PHONY : upload-test 62 | upload-test : 63 | python3 -m twine upload --verbose --repository testpypi dist/* 64 | 65 | requirements.txt: poetry.lock 66 | ./freeze.sh > $(@) 67 | -------------------------------------------------------------------------------- /README.rst: -------------------------------------------------------------------------------- 1 | ====== 2 | pccc 3 | ====== 4 | 5 | The Python Conventional Commit Checker. 6 | 7 | .. image:: https://badge.fury.io/py/pccc.svg 8 | :target: https://badge.fury.io/py/pccc 9 | :alt: PyPI Version 10 | .. image:: https://readthedocs.org/projects/pccc/badge/?version=latest 11 | :target: https://pccc.readthedocs.io/en/latest/?badge=latest 12 | :alt: Documentation Status 13 | 14 | Description 15 | =========== 16 | 17 | pccc is a PyParsing based grammar and script for parsing and verifying 18 | a commit message is a conventional commit. The default grammar 19 | follows the `specification 20 | `_, but 21 | allows for the definition of types in addition to ``feat`` and ``fix`` 22 | and for the definition of project specific scopes and footers in 23 | compliance with the specification. The maximum line lengths of the 24 | commit header and commit body and spelling can also be checked. 25 | 26 | Currently, the script interface will load configuration options and a 27 | commit message and attempt to parse it. If there are no parse 28 | exceptions, it will return 0, otherwise 1. This interface should be 29 | usable at the git ``commit-msg`` hook stage now. It can also be 30 | configured to ignore certain automatically generated commits (from 31 | ``git pull`` for instance) if it is not desirable or possible to 32 | generate those commits as conventional commits (preferable). 33 | 34 | Parsing Grammar 35 | =============== 36 | 37 | Github Closes Issue Syntax 38 | 39 | * KEYWORD = '(close[ds]?|fix(?:es|ed)?|resolve[ds]?)' 40 | * OWNER = '^[a-zA-Z0-9](?:[a-zA-Z0-9]|-(?=[a-zA-Z0-9])){0,38}$' 41 | * REPOSITORY = '^[a-zA-Z0-9](?:[a-zA-Z0-9]|-(?=[a-zA-Z0-9])){0,38}$' 42 | * ISSUE-NUMBER = '#\d+' 43 | * Single issue in same repository: KEYWORD #ISSUE-NUMBER 44 | * Single issue in different repository: KEYWORD OWNER/REPOSITORY ISSUE-NUMBER 45 | * Multiple issues: use full syntax for each issue 46 | 47 | The parser in ``pccc`` requires separating multiple issues on the ``Github-issues`` line with ", ". 48 | 49 | See: 50 | 51 | #. https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue/ 52 | #. https://github.com/shinn/github-username-regex/ 53 | 54 | Installation 55 | ============ 56 | 57 | Install pccc with:: 58 | 59 | pip install pccc 60 | pip freeze > requirements.txt 61 | 62 | or add as a poetry dev-dependency. 63 | 64 | If you desire a package locally built with poetry, download the 65 | source, change the appropriate lines in ``pyproject.toml``, and 66 | rebuild. 67 | 68 | To use as a git ``commit-msg`` hook, copy the script ``pccc`` to 69 | ``.git/hooks/commit-msg`` and set the file as executable or integrate 70 | the script or module into your existing ``commit-msg`` hook. ``pccc`` 71 | relies on ``git`` setting the current working directory of the script 72 | to the root of the repository (where ``pyproject.toml`` or 73 | ``package.json`` typically lives). If this is not the repository 74 | default, pass the configuration file path as an argument or symlink 75 | from the current working directory to an appropriate configuration 76 | file. 77 | 78 | Usage 79 | ===== 80 | 81 | Console:: 82 | 83 | pccc COMMIT_MSG 84 | cat COMMIT_MSG | pccc 85 | 86 | In Python:: 87 | 88 | >>> import pccc 89 | >>> ccr = pccc.ConventionalCommitRunner() 90 | >>> ccr.options.load() 91 | >>> ccr.raw = "some commit message" 92 | >>> ccr.clean() 93 | >>> ccr.parse() 94 | >>> if ccr.exc == None: 95 | ... print(ccr) 96 | 97 | See the source and `documentation 98 | `_ for more information. 99 | 100 | Configuration 101 | ============= 102 | 103 | See ``pccc.toml`` for an example ``[tool.pccc]`` section that may be 104 | copied into a ``pyproject.toml`` file. The same entries may be used 105 | in a ``pccc`` entry in ``package.json`` for JavaScript/TypeScript 106 | projects. 107 | 108 | Copyright and License 109 | ===================== 110 | 111 | SPDX-License-Identifier: `GPL-3.0-or-later 112 | `_ 113 | 114 | pccc, the Python Conventional Commit Checker. 115 | Copyright (C) 2020-2021 `Jeremy A Gray `_. 116 | 117 | This program is free software: you can redistribute it and/or modify 118 | it under the terms of the `GNU General Public License 119 | `_ as published by the Free 120 | Software Foundation, either version 3 of the License, or (at your 121 | option) any later version. 122 | 123 | This program is distributed in the hope that it will be useful, but 124 | WITHOUT ANY WARRANTY; without even the implied warranty of 125 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 126 | General Public License for more details. 127 | 128 | You should have received a copy of the `GNU General Public License 129 | `_ along with this program. 130 | If not, see https://www.gnu.org/licenses/. 131 | 132 | Author 133 | ====== 134 | 135 | `Jeremy A Gray `_ 136 | -------------------------------------------------------------------------------- /bin/pccc.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """Module wrapper for development.""" 3 | 4 | import sys 5 | 6 | sys.path.insert(0, "/home/gray/src/work/pccc") 7 | 8 | import pccc # noqa: E402 9 | 10 | if __name__ == "__main__": 11 | pccc.main() 12 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line, and also 5 | # from the environment for the first two. 6 | SPHINXOPTS ?= 7 | SPHINXBUILD ?= sphinx-build 8 | SOURCEDIR = . 9 | BUILDDIR = _build 10 | 11 | # Put it first so that "make" without argument is like "make help". 12 | help: 13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 14 | 15 | .PHONY: help Makefile 16 | 17 | # Catch-all target: route all unknown targets to Sphinx using the new 18 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 19 | %: Makefile 20 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 21 | -------------------------------------------------------------------------------- /docs/classes.rst: -------------------------------------------------------------------------------- 1 | .. SPDX-License-Identifier: GPL-3.0-or-later 2 | .. 3 | .. pccc, the Python Conventional Commit Checker. 4 | .. Copyright (C) 2020-2021 Jeremy A Gray . 5 | 6 | Classes 7 | ======= 8 | 9 | .. toctree:: 10 | :maxdepth: 2 11 | 12 | ConventionalCommit 13 | ------------------ 14 | 15 | .. autoclass:: pccc::ConventionalCommit 16 | :members: 17 | 18 | ConventionalCommitRunner 19 | ------------------------ 20 | 21 | .. autoclass:: pccc::ConventionalCommitRunner 22 | :members: 23 | 24 | Config 25 | ------ 26 | 27 | .. autoclass:: pccc::Config 28 | :members: 29 | -------------------------------------------------------------------------------- /docs/cli.rst: -------------------------------------------------------------------------------- 1 | .. SPDX-License-Identifier: GPL-3.0-or-later 2 | .. 3 | .. pccc, the Python Conventional Commit Checker. 4 | .. Copyright (C) 2020-2021 Jeremy A Gray . 5 | 6 | CLI Arguments 7 | ============= 8 | 9 | usage: pccc.py [-h] [--show-warranty] [--show-license] [-o CONFIG_FILE] 10 | [-l HEADER_LENGTH] [-b BODY_LENGTH] [-c | -C] [-i | -I] [-w | -W] 11 | [-r | -R] [-t TYPES] [-a GENERATED_COMMITS] [-s SCOPES] 12 | [-f FOOTERS] [-g REQUIRED_FOOTERS] 13 | [commit] 14 | 15 | This program comes with ABSOLUTELY NO WARRANTY; for details type ``pccc --show- 16 | warranty``. This is free software, and you are welcome to redistribute it under 17 | certain conditions; type ``pccc --show-license`` for details. 18 | 19 | positional arguments: 20 | commit Commit message file. 21 | 22 | optional arguments: 23 | -h, --help show this help message and exit 24 | --show-warranty Show warranty information. 25 | --show-license Show license information. 26 | -o CONFIG_FILE, --config-file CONFIG_FILE 27 | Path to configuration file. Default is ./pyproject.toml. 28 | -l HEADER_LENGTH, --header-length HEADER_LENGTH 29 | Maximum length of commit header. Default is 50. 30 | -b BODY_LENGTH, --body-length BODY_LENGTH 31 | Maximum length of a body line. Default is 72. 32 | -c, --spell-check Spell check the commit. Default is no spell checking. 33 | -C, --no-spell-check Do not spell check the commit. Default is no spell 34 | checking. 35 | -i, --ignore-generated-commits 36 | Ignore generated commits that match the patterns in 37 | ``generated_commits``. Default is to check every commit. 38 | -I, --no-ignore-generated-commits 39 | Do not ignore generated commits that match the patterns 40 | in ``generated_commits``. Default is to check every 41 | commit. 42 | -w, --rewrap Rewrap the body commit, regardless of line length. 43 | Default is no rewrapping. 44 | -W, --no-rewrap Do not rewrap the body commit, regardless of line 45 | length. Default is no rewrapping. 46 | -r, --repair Repair the body commit as necessary; implies spell check 47 | and rewrap. Default is false. 48 | -R, --no-repair Do not repair the body commit; implies no spell check 49 | and no rewrap. Default is false. 50 | -t TYPES, --types TYPES 51 | List (comma delimited) of allowable types for the type 52 | field of header. Default is `['fix', 'feat']`. 53 | -a GENERATED_COMMITS, --generated-commits GENERATED_COMMITS 54 | List (comma delimited) of Python regular expressions 55 | that match generated commits that should be ignored. 56 | Mind the shell escaping. Default is ``[]``. 57 | -s SCOPES, --scopes SCOPES 58 | List (comma delimited) of allowable scopes for the scope 59 | field of header. Default is an empty list. 60 | -f FOOTERS, --footers FOOTERS 61 | List (comma delimited) of allowable footer tokens for 62 | the commit footers. Default is an empty list. 63 | -g REQUIRED_FOOTERS, --required-footers REQUIRED_FOOTERS 64 | List (comma delimited) of required footer tokens for the 65 | commit footers. Default is an empty list. 66 | -------------------------------------------------------------------------------- /docs/conf.py: -------------------------------------------------------------------------------- 1 | # ****************************************************************************** 2 | # 3 | # pccc, the Python Conventional Commit Checker. 4 | # 5 | # Copyright 2020-2022 Jeremy A Gray . 6 | # 7 | # SPDX-License-Identifier: GPL-3.0-or-later 8 | # 9 | # ****************************************************************************** 10 | 11 | """Sphinx configuration.""" 12 | 13 | # Configuration file for the Sphinx documentation builder. 14 | # 15 | # This file only contains a selection of the most common options. For a full 16 | # list see the documentation: 17 | # https://www.sphinx-doc.org/en/master/usage/configuration.html 18 | 19 | # -- Path setup -------------------------------------------------------------- 20 | 21 | # If extensions (or modules to document with autodoc) are in another directory, 22 | # add these directories to sys.path here. If the directory is relative to the 23 | # documentation root, use os.path.abspath to make it absolute, like shown here. 24 | # 25 | import os 26 | import sys 27 | 28 | sys.path.insert(0, os.path.abspath("..")) 29 | 30 | 31 | # -- Project information ----------------------------------------------------- 32 | 33 | project = "pccc" 34 | copyright = "2021-2022, Jeremy A Gray" 35 | author = "Jeremy A Gray" 36 | 37 | # The full version, including alpha/beta/rc tags 38 | release = "0.4.14" 39 | 40 | 41 | # -- General configuration --------------------------------------------------- 42 | 43 | # Add any Sphinx extension module names here, as strings. They can be 44 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom 45 | # ones. 46 | extensions = [ 47 | "sphinx.ext.autodoc", 48 | "sphinx.ext.autosummary", 49 | "sphinx.ext.napoleon", 50 | ] 51 | 52 | autosummary_generate = True 53 | 54 | # Add any paths that contain templates here, relative to this directory. 55 | templates_path = ["_templates"] 56 | 57 | # List of patterns, relative to source directory, that match files and 58 | # directories to ignore when looking for source files. 59 | # This pattern also affects html_static_path and html_extra_path. 60 | exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] 61 | 62 | 63 | # -- Options for HTML output ------------------------------------------------- 64 | 65 | # The theme to use for HTML and HTML Help pages. See the documentation for 66 | # a list of builtin themes. 67 | # 68 | html_theme = "alabaster" 69 | 70 | # Add any paths that contain custom static files (such as style sheets) here, 71 | # relative to this directory. They are copied after the builtin static files, 72 | # so a file named "default.css" will overwrite the builtin "default.css". 73 | html_static_path = ["_static"] 74 | -------------------------------------------------------------------------------- /docs/functions.rst: -------------------------------------------------------------------------------- 1 | .. SPDX-License-Identifier: GPL-3.0-or-later 2 | .. 3 | .. pccc, the Python Conventional Commit Checker. 4 | .. Copyright (C) 2020-2021 Jeremy A Gray . 5 | 6 | Functions 7 | ========= 8 | 9 | .. toctree:: 10 | :maxdepth: 2 11 | 12 | pccc.main() 13 | ----------- 14 | 15 | .. autofunction:: pccc.main 16 | -------------------------------------------------------------------------------- /docs/index.rst: -------------------------------------------------------------------------------- 1 | .. SPDX-License-Identifier: GPL-3.0-or-later 2 | .. 3 | .. pccc, the Python Conventional Commit Checker. 4 | .. Copyright (C) 2020-2021 Jeremy A Gray . 5 | 6 | pccc Documentation 7 | ================== 8 | 9 | .. toctree:: 10 | :maxdepth: 3 11 | :caption: Contents: 12 | 13 | ../readme 14 | ../classes 15 | ../functions 16 | ../cli 17 | ../license 18 | 19 | 20 | Indices and Tables 21 | ================== 22 | 23 | * :ref:`genindex` 24 | * :ref:`modindex` 25 | * :ref:`search` 26 | -------------------------------------------------------------------------------- /docs/license.rst: -------------------------------------------------------------------------------- 1 | .. SPDX-License-Identifier: GPL-3.0-or-later 2 | .. 3 | .. pccc, the Python Conventional Commit Checker. 4 | .. Copyright (C) 2020-2021 Jeremy A Gray . 5 | 6 | License 7 | ======= 8 | 9 | .. include:: ../LICENSE.rst 10 | -------------------------------------------------------------------------------- /docs/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | pushd %~dp0 4 | 5 | REM Command file for Sphinx documentation 6 | 7 | if "%SPHINXBUILD%" == "" ( 8 | set SPHINXBUILD=sphinx-build 9 | ) 10 | set SOURCEDIR=. 11 | set BUILDDIR=_build 12 | 13 | if "%1" == "" goto help 14 | 15 | %SPHINXBUILD% >NUL 2>NUL 16 | if errorlevel 9009 ( 17 | echo. 18 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 19 | echo.installed, then set the SPHINXBUILD environment variable to point 20 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 21 | echo.may add the Sphinx directory to PATH. 22 | echo. 23 | echo.If you don't have Sphinx installed, grab it from 24 | echo.http://sphinx-doc.org/ 25 | exit /b 1 26 | ) 27 | 28 | %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 29 | goto end 30 | 31 | :help 32 | %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 33 | 34 | :end 35 | popd 36 | -------------------------------------------------------------------------------- /docs/readme.rst: -------------------------------------------------------------------------------- 1 | .. SPDX-License-Identifier: GPL-3.0-or-later 2 | .. 3 | .. pccc, the Python Conventional Commit Checker. 4 | .. Copyright (C) 2020-2021 Jeremy A Gray . 5 | 6 | README 7 | ====== 8 | 9 | .. include:: ../README.rst 10 | -------------------------------------------------------------------------------- /freeze.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | #*********************************************************************** 4 | # 5 | # pccc, the Python Conventional Commit Checker. 6 | # 7 | # SPDX-License-Identifier: GPL-3.0-or-later 8 | # 9 | # Copyright 2020-2022 Jeremy A Gray . 10 | # 11 | #*********************************************************************** 12 | 13 | grep='/usr/bin/grep' 14 | pip='/home/gray/.virtualenvs/pccc/bin/pip' 15 | sed='/usr/bin/sed' 16 | 17 | pip freeze | ${sed} 's/ @ .*-\(.*\)\(-py[23]\|-cp39-cp39\|-cp36\|\.tar\).*$/==\1/' | ${grep} -v '\(poetry\|pccc\|pkg-resources\)' 18 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "pccc": { 3 | "header_length": 50, 4 | "body_length": 72, 5 | "rewrap": true, 6 | "spell_check": false, 7 | "repair": false, 8 | "types": [ 9 | "build", 10 | "ci", 11 | "depends", 12 | "docs", 13 | "feat", 14 | "fix", 15 | "perf", 16 | "refactor", 17 | "release", 18 | "style", 19 | "test" 20 | ], 21 | "scopes": [ 22 | "config", 23 | "parser" 24 | ], 25 | "footers": [ 26 | "signed-off-by" 27 | ], 28 | "required_footers": [ 29 | "signed-off-by" 30 | ] 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /pccc.toml: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: GPL-3.0-or-later 2 | # 3 | # pccc, the Python Conventional Commit Checker. 4 | # Copyright (C) 2020-2021 Jeremy A Gray . 5 | 6 | [tool.pccc] 7 | 8 | header_length = 50 9 | body_length = 72 10 | rewrap = true 11 | spell_check = false 12 | repair = false 13 | 14 | types = [ 15 | "build", 16 | "ci", 17 | "docs", 18 | "feat", 19 | "fix", 20 | "perf", 21 | "refactor", 22 | "release", 23 | "style", 24 | "test" 25 | ] 26 | 27 | scopes = [ 28 | "config", 29 | "parser" 30 | ] 31 | 32 | footers = [ 33 | "signed-off-by" 34 | ] 35 | -------------------------------------------------------------------------------- /pccc/__init__.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: GPL-3.0-or-later 2 | # 3 | # pccc, the Python Conventional Commit Checker. 4 | # Copyright (C) 2020-2021 Jeremy A Gray . 5 | """Python Conventional Commit Checker. 6 | 7 | Contains the ConventionalCommit class and all the helper functions for 8 | loading, cleaning, and parsing a conventional commit. 9 | 10 | For programs, the main entry point should be pccc.main(). For 11 | scripts, pccc.ConventionalCommit() may be used directly: 12 | 13 | Examples 14 | -------- 15 | >>> # Program: 16 | >>> import pccc 17 | >>> pccc.main() 18 | 19 | >>> # From script: 20 | >>> import pccc 21 | >>> ccr = pccc.ConventionalCommitRunner() 22 | >>> # Load configuration. 23 | >>> ccr.options.load() 24 | >>> # Get commit. 25 | >>> ccr.get() 26 | >>> # Clean commit. 27 | >>> ccr.clean() 28 | >>> # Parse commit. 29 | >>> ccr.parse() 30 | """ 31 | from .config import Config 32 | from .config import _determine_file_format 33 | from .config import _load_bespon_file 34 | from .config import _load_json_file 35 | from .config import _load_toml_file 36 | from .config import _load_yaml_file 37 | from .exceptions import BodyLengthError 38 | from .exceptions import BreakingLengthError 39 | from .exceptions import ClosesIssueParseException 40 | from .exceptions import HeaderLengthError 41 | from .parser import ConventionalCommit 42 | from .parser import ConventionalCommitRunner 43 | from .parser import main 44 | -------------------------------------------------------------------------------- /pccc/exceptions.py: -------------------------------------------------------------------------------- 1 | # ****************************************************************************** 2 | # 3 | # pccc, the Python Conventional Commit Checker. 4 | # 5 | # SPDX-License-Identifier: GPL-3.0-or-later 6 | # 7 | # Copyright 2020-2022 Jeremy A Gray . 8 | # 9 | # ****************************************************************************** 10 | 11 | """pccc exceptions.""" 12 | 13 | from pyparsing import ParseFatalException 14 | 15 | 16 | class ClosesIssueParseException(ParseFatalException): 17 | """Github closes issue string not parseable.""" 18 | 19 | def __init__(self, string, loc, msg=None, elem=None): 20 | """Initialize a ``ClosesIssueParseException``.""" 21 | super().__init__(string, loc, msg=msg, elem=elem) 22 | self.string = string 23 | self.loc = loc 24 | self.msg = msg 25 | self.elem = elem 26 | 27 | def __str__(self): 28 | """Stringify a ``ClosesIssueParseException``.""" 29 | parseable = self.string[: self.loc] 30 | bad_char = self.string[self.loc] 31 | unparseable = self.string[self.loc + 1 :] 32 | msg = ( 33 | "One or more malformed Github issue references on or after" 34 | f" character position {self.loc + 1} in" 35 | f'"{parseable}[{bad_char}]{unparseable}".' 36 | ) 37 | msg += f"\nparseable: {parseable}" 38 | msg += f"\nunparseable: {bad_char + unparseable}" 39 | 40 | return msg 41 | 42 | def __repr__(self): 43 | """Reproduce a ``ClosesIssueParseException``.""" 44 | return ( 45 | "ClosesIssueParseException(" 46 | f"string={repr(self.string)}," 47 | f" loc={repr(self.loc)}," 48 | f" msg={repr(self.msg)}," 49 | f" elem={repr(self.elem)}," 50 | ")" 51 | ) 52 | 53 | 54 | class HeaderLengthError(ValueError): 55 | """Header length error.""" 56 | 57 | def __init__(self, length, max_length, header): 58 | """Initialize a ``HeaderLengthError``.""" 59 | message = ( 60 | f"Commit header length ({length}) exceeds" 61 | f" the maximum length ({max_length})." 62 | ) 63 | 64 | super().__init__(message) 65 | self.length = length 66 | self.max_length = max_length 67 | self.header = header 68 | self.message = message 69 | 70 | def __str__(self): 71 | """Stringify a ``HeaderLengthError``.""" 72 | return self.message 73 | 74 | def __repr__(self): 75 | """Reproduce a ``HeaderLengthError``.""" 76 | return ( 77 | "HeaderLengthError(" 78 | f"length={repr(self.length)}," 79 | f" max_length={repr(self.max_length)}," 80 | f" header={repr(self.header)}," 81 | f" message={repr(self.message)}," 82 | ")" 83 | ) 84 | 85 | 86 | class BodyLengthError(ValueError): 87 | """Body length error.""" 88 | 89 | def __init__(self, longest, max_length): 90 | """Initialize a ``BodyLengthError``.""" 91 | message = ( 92 | f"Commit body length ({longest}) exceeds" 93 | f" the maximum length ({max_length})." 94 | ) 95 | 96 | super().__init__(message) 97 | self.longest = longest 98 | self.max_length = max_length 99 | self.message = message 100 | 101 | def __str__(self): 102 | """Stringify a ``BodyLengthError``.""" 103 | return self.message 104 | 105 | def __repr__(self): 106 | """Reproduce a ``BodyLengthError``.""" 107 | return ( 108 | "BodyLengthError(" 109 | f"longest={repr(self.longest)}," 110 | f" max_length={repr(self.max_length)}," 111 | f" message={repr(self.message)}," 112 | ")" 113 | ) 114 | 115 | 116 | class BreakingLengthError(ValueError): 117 | """Breaking change description length error.""" 118 | 119 | def __init__(self, longest, max_length): 120 | """Initialize a ``BreakingLengthError``.""" 121 | message = ( 122 | f"Commit breaking change length ({longest}) exceeds" 123 | f" the maximum length ({max_length})." 124 | ) 125 | 126 | super().__init__(message) 127 | self.longest = longest 128 | self.max_length = max_length 129 | self.message = message 130 | 131 | def __str__(self): 132 | """Stringify a ``BreakingLengthError``.""" 133 | return self.message 134 | 135 | def __repr__(self): 136 | """Reproduce a ``BreakingLengthError``.""" 137 | return ( 138 | "BreakingLengthError(" 139 | f"longest={repr(self.longest)}," 140 | f" max_length={repr(self.max_length)}," 141 | f" message={repr(self.message)}," 142 | ")" 143 | ) 144 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | # ****************************************************************************** 2 | # 3 | # pccc, the Python Conventional Commit Checker. 4 | # 5 | # Copyright 2020-2022 Jeremy A Gray . 6 | # 7 | # SPDX-License-Identifier: GPL-3.0-or-later 8 | # 9 | # ****************************************************************************** 10 | 11 | [build-system] 12 | 13 | # Setuptools. 14 | requires = [ 15 | "setuptools", 16 | "wheel", 17 | ] 18 | build-backend = "setuptools.build_meta" 19 | 20 | # Poetry. 21 | # requires = ["poetry_core>=1.0.0"] 22 | # build-backend = "poetry.core.masonry.api" 23 | 24 | [tool] 25 | 26 | [tool.black] 27 | 28 | line-length = 88 29 | target-version = ['py38'] 30 | include = '\.pyi?$' 31 | exclude = ''' 32 | 33 | ( 34 | /( 35 | \.git 36 | | \.pytest_cache 37 | | __pycache__ 38 | | htmlcov 39 | )/ 40 | ) 41 | ''' 42 | 43 | [tool.isort] 44 | 45 | ensure_newline_before_comments = true 46 | force_single_line = true 47 | include_trailing_comma = true 48 | line_length = 88 49 | multi_line_output = 3 50 | use_parentheses = true 51 | 52 | [tool.pccc] 53 | 54 | header_length = 50 55 | body_length = 72 56 | wrap = true 57 | force_wrap = true 58 | spell_check = false 59 | repair = false 60 | ignore_generated_commits = true 61 | 62 | generated_commits = [ 63 | '''^\(tag:\s+v\d+\.\d+\.\d\)\s+\d+\.\d+\.\d+$''', 64 | '''^Merge branch 'master' of.*$''', 65 | ] 66 | 67 | types = [ 68 | "build", 69 | "ci", 70 | "depends", 71 | "docs", 72 | "feat", 73 | "fix", 74 | "perf", 75 | "refactor", 76 | "release", 77 | "style", 78 | "test", 79 | ] 80 | 81 | scopes = [ 82 | "config", 83 | "docs", 84 | "parser", 85 | "tooling", 86 | ] 87 | 88 | footers = [ 89 | "github-closes", 90 | "signed-off-by", 91 | ] 92 | 93 | required_footers = [ 94 | "signed-off-by", 95 | ] 96 | 97 | [tool.poetry] 98 | 99 | authors = ["Jeremy A Gray "] 100 | description = "pccc: the Python Conventional Commit Checker" 101 | name = "pccc" 102 | version = "0.4.14" 103 | license = "GPL-3.0-or-later" 104 | maintainers = ["Jeremy A Gray "] 105 | readme = "README.rst" 106 | homepage = "https://github.com/jeremyagray/pccc" 107 | repository = "https://github.com/jeremyagray/pccc" 108 | 109 | classifiers = [ 110 | "Development Status :: 3 - Alpha", 111 | "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)", 112 | "Intended Audience :: Developers", 113 | "Programming Language :: Python :: 3.7", 114 | "Programming Language :: Python :: 3.8", 115 | "Programming Language :: Python :: 3.9", 116 | "Programming Language :: Python :: 3.10", 117 | "Programming Language :: Python :: 3.11", 118 | "Topic :: Software Development :: Version Control :: Git", 119 | ] 120 | 121 | packages = [ 122 | { include = "pccc" }, 123 | ] 124 | 125 | [tool.poetry.dependencies] 126 | 127 | bespon = "^0" 128 | pyenchant = "^3" 129 | pyparsing = "^3" 130 | python = ">=3.8.1,<4.0" 131 | "ruamel.yaml" = "^0" 132 | toml = "^0" 133 | tox = "^4" 134 | 135 | [tool.poetry.dev-dependencies] 136 | 137 | Sphinx = "^6" 138 | black = { version = "*", allow-prereleases = true } 139 | factory-boy = "^3.2" 140 | flake8 = "^6" 141 | flake8-docstrings = "^1" 142 | isort = "^5" 143 | hypothesis = "^6" 144 | pre-commit = "^3" 145 | pyfakefs = "^5" 146 | pytest = "^7" 147 | pytest-cov = "^4" 148 | 149 | [tool.poetry.scripts] 150 | 151 | pccc = "pccc:main" 152 | 153 | [tool.poetry.urls] 154 | 155 | "Issues" = "https://github.com/jeremyagray/pccc/issues" 156 | "Documentation" = "https://pccc.readthedocs.io/" 157 | "Repository" = "https://github.com/jeremyagray/pccc" 158 | 159 | [tool.pytest.ini_options] 160 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | alabaster==0.7.12 2 | appdirs==1.4.4 3 | attrs==21.4.0 4 | Babel==2.9.1 5 | BespON==0.6.0 6 | black==20.8b1 7 | bleach==4.1.0 8 | build==0.7.0 9 | certifi==2021.10.8 10 | cffi==1.15.0 11 | cfgv==3.3.1 12 | charset-normalizer==2.0.12 13 | click==8.0.4 14 | cryptography==36.0.2 15 | distlib==0.3.4 16 | docutils==0.17.1 17 | factory-boy==3.2.1 18 | Faker==13.3.4 19 | filelock==3.4.1 20 | flake8==3.9.2 21 | flake8-docstrings==1.6.0 22 | hypothesis==6.31.6 23 | identify==2.4.4 24 | idna==3.3 25 | imagesize==1.3.0 26 | iniconfig==1.1.1 27 | isort==5.10.1 28 | jeepney==0.7.1 29 | Jinja2==3.0.3 30 | keyring==23.5.0 31 | MarkupSafe==2.0.1 32 | mccabe==0.6.1 33 | mypy-extensions==0.4.3 34 | nodeenv==1.6.0 35 | packaging==21.3 36 | pathspec==0.9.0 37 | pep517==0.12.0 38 | pkginfo==1.8.2 39 | platformdirs==2.4.0 40 | pluggy==1.0.0 41 | pre-commit==2.17.0 42 | py==1.11.0 43 | pycodestyle==2.7.0 44 | pycparser==2.21 45 | pydocstyle==6.1.1 46 | pyenchant==3.2.2 47 | pyfakefs==4.5.6 48 | pyflakes==2.3.1 49 | Pygments==2.11.2 50 | pyparsing==3.0.7 51 | pytest==6.2.5 52 | pytest-cov==2.12.1 53 | python-dateutil==2.8.2 54 | pytz==2022.1 55 | readme-renderer==34.0 56 | requests==2.27.1 57 | requests-toolbelt==0.9.1 58 | rfc3986==2.0.0 59 | ruamel.yaml==0.17.21 60 | ruamel.yaml.clib==0.2.6 61 | SecretStorage==3.3.1 62 | six==1.16.0 63 | snowballstemmer==2.2.0 64 | sortedcontainers==2.4.0 65 | Sphinx==4.5.0 66 | sphinxcontrib-applehelp==1.0.2 67 | sphinxcontrib-devhelp==1.0.2 68 | sphinxcontrib-htmlhelp==2.0.0 69 | sphinxcontrib-jsmath==1.0.1 70 | sphinxcontrib-qthelp==1.0.3 71 | sphinxcontrib-serializinghtml==1.1.5 72 | toml==0.10.2 73 | tomli==2.0.1 74 | tox==3.24.5 75 | tqdm==4.63.1 76 | twine==3.8.0 77 | typing_extensions==4.1.1 78 | urllib3==1.26.9 79 | virtualenv==20.14.0 80 | webencodings==0.5.1 81 | -------------------------------------------------------------------------------- /setup.cfg: -------------------------------------------------------------------------------- 1 | # ****************************************************************************** 2 | # 3 | # pccc, the Python Conventional Commit Checker. 4 | # 5 | # Copyright 2020-2022 Jeremy A Gray . 6 | # 7 | # SPDX-License-Identifier: GPL-3.0-or-later 8 | # 9 | # ****************************************************************************** 10 | 11 | [metadata] 12 | 13 | author = Jeremy A Gray 14 | author_email = gray@flyquackswim.com 15 | description = Python Conventional Commit Checker 16 | license = GPL-3.0-or-later 17 | license_file = LICENSE.rst 18 | long_description = file: README.rst 19 | long_description_content_type = text/x-rst 20 | maintainer = Jeremy A Gray 21 | maintainer_email = gray@flyquackswim.com 22 | name = pccc 23 | url = https://github.com/jeremyagray/pccc 24 | version = 0.4.14 25 | 26 | project_urls = 27 | Issues = https://github.com/jeremyagray/pccc/issues 28 | Documentation = https://pccc.readthedocs.io/ 29 | Repository = https://github.com/jeremyagray/pccc 30 | 31 | classifiers = 32 | Development Status :: 3 - Alpha 33 | License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+) 34 | Intended Audience :: Developers 35 | Programming Language :: Python :: 3.7 36 | Programming Language :: Python :: 3.8 37 | Programming Language :: Python :: 3.9 38 | Programming Language :: Python :: 3.10 39 | Programming Language :: Python :: 3.11 40 | Topic :: Software Development :: Version Control :: Git 41 | 42 | [options] 43 | 44 | packages = pccc 45 | 46 | install_requires = 47 | bespon 48 | pyenchant 49 | pyparsing 50 | ruamel.yaml 51 | toml 52 | 53 | tests_require = 54 | black 55 | factory-boy 56 | flake8 57 | flake8-docstrings 58 | hypothesis 59 | isort 60 | pyfakefs 61 | pytest 62 | pytest-cov 63 | tox 64 | 65 | [options.entry_points] 66 | 67 | console_scripts = 68 | pccc = pccc:main 69 | -------------------------------------------------------------------------------- /tests/config/0001.json: -------------------------------------------------------------------------------- 1 | { 2 | "valid": true, 3 | "pyproject": "[tool.pccc]\n\nheader_length = 50\nbody_length = 72\nrewrap = true\nspell_check = false\nrepair = false\n\ntypes = [\n \"build\",\n \"docs\",\n \"feat\",\n \"fix\",\n \"refactor\",\n \"test\"\n]\n\nscopes = [\n \"config\",\n \"parser\"\n]\n\nfooters = [\n \"signed-off-by\"\n]\n\nrequired_footers = [\n \"signed-off-by\"\n]\n", 4 | "pccc": { 5 | "header_length": 50, 6 | "body_length": 72, 7 | "rewrap": true, 8 | "spell_check": false, 9 | "repair": false, 10 | "types": [ 11 | "build", 12 | "docs", 13 | "feat", 14 | "fix", 15 | "refactor", 16 | "test" 17 | ], 18 | "scopes": [ 19 | "config", 20 | "parser" 21 | ], 22 | "footers": [ 23 | "signed-off-by" 24 | ], 25 | "required_footers": [ 26 | "signed-off-by" 27 | ] 28 | }, 29 | "cli": [ 30 | ], 31 | "config": { 32 | "commit": "-", 33 | "config_file": "./pyproject.toml", 34 | "header_length": 50, 35 | "body_length": 72, 36 | "rewrap": true, 37 | "spell_check": false, 38 | "repair": false, 39 | "types": [ 40 | "build", 41 | "docs", 42 | "feat", 43 | "fix", 44 | "refactor", 45 | "test" 46 | ], 47 | "scopes": [ 48 | "config", 49 | "parser" 50 | ], 51 | "footers": [ 52 | "signed-off-by" 53 | ], 54 | "required_footers": [ 55 | "signed-off-by" 56 | ] 57 | }, 58 | "str": "[tool.pccc]\n\nheader_length = 50\nbody_length = 72\nrepair = false\nrewrap = true\nspell_check = false\nignore_generated_commits = false\n\ngenerated_commits = [\n]\n\ntypes = [\n \"build\",\n \"docs\",\n \"feat\",\n \"fix\",\n \"refactor\",\n \"test\"\n]\n\nscopes = [\n \"config\",\n \"parser\"\n]\n\nfooters = [\n \"signed-off-by\"\n]\n\nrequired_footers = [\n \"signed-off-by\"\n]\n", 59 | "repr": "Config(commit=\"-\", config_file=\"./pyproject.toml\", header_length=50, body_length=72, repair=False, rewrap=True, spell_check=False, ignore_generated_commits=False, generated_commits=[], types=['build', 'docs', 'feat', 'fix', 'refactor', 'test'], scopes=['config', 'parser'], footers=['signed-off-by'], required_footers=['signed-off-by'])" 60 | } 61 | -------------------------------------------------------------------------------- /tests/config/0002.json: -------------------------------------------------------------------------------- 1 | { 2 | "valid": false, 3 | "pyproject": "[tool.pccc]\n\nheader_length = 50\nbody_length = 72\nrewrap = true\nspell_check = false\nrepair = false\n\ntypes = [\n \"build\",\n \"docs\",\n \"fix\",\n \"refactor\",\n \"test\"\n]\n\nscopes = [\n \"config\",\n \"parser\"\n]\n\nfooters = [\n \"signed-off-by\"\n]\n\nrequired_footers = [\n \"signed-off-by\"\n]\n", 4 | "pccc": { 5 | "header_length": 50, 6 | "body_length": 72, 7 | "rewrap": true, 8 | "spell_check": false, 9 | "repair": false, 10 | "types": [ 11 | "build", 12 | "docs", 13 | "fix", 14 | "refactor", 15 | "test" 16 | ], 17 | "scopes": [ 18 | "config", 19 | "parser" 20 | ], 21 | "footers": [ 22 | "signed-off-by" 23 | ], 24 | "required_footers": [ 25 | "signed-off-by" 26 | ] 27 | }, 28 | "cli": [ 29 | ], 30 | "config": { 31 | "commit": "-", 32 | "config_file": "./pyproject.toml", 33 | "header_length": 50, 34 | "body_length": 72, 35 | "rewrap": true, 36 | "spell_check": false, 37 | "repair": false, 38 | "types": [ 39 | "build", 40 | "docs", 41 | "fix", 42 | "refactor", 43 | "test" 44 | ], 45 | "scopes": [ 46 | "config", 47 | "parser" 48 | ], 49 | "footers": [ 50 | "signed-off-by" 51 | ], 52 | "required_footers": [ 53 | "signed-off-by" 54 | ] 55 | }, 56 | "str": "[tool.pccc]\n\nheader_length = 50\nbody_length = 72\nrepair = false\nrewrap = true\nspell_check = false\n\ntypes = [\n \"build\",\n \"docs\",\n \"fix\",\n \"refactor\",\n \"test\"\n]\n\nscopes = [\n \"config\",\n \"parser\"\n]\n\nfooters = [\n \"signed-off-by\"\n]\n\nrequired_footers = [\n \"signed-off-by\"\n]\n", 57 | "repr": "Config(commit=\"-\", config_file=\"./pyproject.toml\", header_length=50, body_length=72, repair=False, rewrap=True, spell_check=False, types=['build', 'docs', 'fix', 'refactor', 'test'], scopes=['config', 'parser'], footers=['signed-off-by'], required_footers=['signed-off-by'])" 58 | } 59 | -------------------------------------------------------------------------------- /tests/config/0003.json: -------------------------------------------------------------------------------- 1 | { 2 | "valid": false, 3 | "pyproject": "[tool.pccc]\n\nheader_length = 50\nbody_length = 72\nrewrap = true\nspell_check = false\nrepair = false\n\ntypes = [\n \"build\",\n \"docs\",\n \"feat\",\n \"refactor\",\n \"test\"\n]\n\nscopes = [\n \"config\",\n \"parser\"\n]\n\nfooters = [\n \"signed-off-by\"\n]\n\nrequired_footers = [\n \"signed-off-by\"\n]\n", 4 | "pccc": { 5 | "header_length": 50, 6 | "body_length": 72, 7 | "rewrap": true, 8 | "spell_check": false, 9 | "repair": false, 10 | "types": [ 11 | "build", 12 | "docs", 13 | "feat", 14 | "refactor", 15 | "test" 16 | ], 17 | "scopes": [ 18 | "config", 19 | "parser" 20 | ], 21 | "footers": [ 22 | "signed-off-by" 23 | ], 24 | "required_footers": [ 25 | "signed-off-by" 26 | ] 27 | }, 28 | "cli": [ 29 | ], 30 | "config": { 31 | "commit": "-", 32 | "config_file": "./pyproject.toml", 33 | "header_length": 50, 34 | "body_length": 72, 35 | "rewrap": true, 36 | "spell_check": false, 37 | "repair": false, 38 | "types": [ 39 | "build", 40 | "docs", 41 | "feat", 42 | "refactor", 43 | "test" 44 | ], 45 | "scopes": [ 46 | "config", 47 | "parser" 48 | ], 49 | "footers": [ 50 | "signed-off-by" 51 | ], 52 | "required_footers": [ 53 | "signed-off-by" 54 | ] 55 | }, 56 | "str": "[tool.pccc]\n\nheader_length = 50\nbody_length = 72\nrepair = false\nrewrap = true\nspell_check = false\n\ntypes = [\n \"build\",\n \"docs\",\n \"feat\",\n \"refactor\",\n \"test\"\n]\n\nscopes = [\n \"config\",\n \"parser\"\n]\n\nfooters = [\n \"signed-off-by\"\n]\n\nrequired_footers = [\n \"signed-off-by\"\n]\n", 57 | "repr": "Config(commit=\"-\", config_file=\"./pyproject.toml\", header_length=50, body_length=72, repair=False, rewrap=True, spell_check=False, types=['build', 'docs', 'feat', 'refactor', 'test'], scopes=['config', 'parser'], footers=['signed-off-by'], required_footers=['signed-off-by'])" 58 | } 59 | -------------------------------------------------------------------------------- /tests/config/0004.json: -------------------------------------------------------------------------------- 1 | { 2 | "valid": false, 3 | "pyproject": "[tool.pccc]\n\nheader_length = 50\nbody_length = 72\nrewrap = true\nspell_check = false\nrepair = false\n\ntypes = [\n \"build\",\n \"docs\",\n \"refactor\",\n \"test\"\n]\n\nscopes = [\n \"config\",\n \"parser\"\n]\n\nfooters = [\n \"signed-off-by\"\n]\n\nrequired_footers = [\n \"signed-off-by\"\n]\n", 4 | "pccc": { 5 | "header_length": 50, 6 | "body_length": 72, 7 | "rewrap": true, 8 | "spell_check": false, 9 | "repair": false, 10 | "types": [ 11 | "build", 12 | "docs", 13 | "refactor", 14 | "test" 15 | ], 16 | "scopes": [ 17 | "config", 18 | "parser" 19 | ], 20 | "footers": [ 21 | "signed-off-by" 22 | ], 23 | "required_footers": [ 24 | "signed-off-by" 25 | ] 26 | }, 27 | "cli": [ 28 | ], 29 | "config": { 30 | "commit": "-", 31 | "config_file": "./pyproject.toml", 32 | "header_length": 50, 33 | "body_length": 72, 34 | "rewrap": true, 35 | "spell_check": false, 36 | "repair": false, 37 | "types": [ 38 | "build", 39 | "docs", 40 | "refactor", 41 | "test" 42 | ], 43 | "scopes": [ 44 | "config", 45 | "parser" 46 | ], 47 | "footers": [ 48 | "signed-off-by" 49 | ], 50 | "required_footers": [ 51 | "signed-off-by" 52 | ] 53 | }, 54 | "str": "[tool.pccc]\n\nheader_length = 50\nbody_length = 72\nrepair = false\nrewrap = true\nspell_check = false\n\ntypes = [\n \"build\",\n \"docs\",\n \"refactor\",\n \"test\"\n]\n\nscopes = [\n \"config\",\n \"parser\"\n]\n\nfooters = [\n \"signed-off-by\"\n]\n\nrequired_footers = [\n \"signed-off-by\"\n]\n", 55 | "repr": "Config(commit=\"-\", config_file=\"./pyproject.toml\", header_length=50, body_length=72, repair=False, rewrap=True, spell_check=False, types=['build', 'docs', 'refactor', 'test'], scopes=['config', 'parser'], footers=['signed-off-by'], required_footers=['signed-off-by'])" 56 | } 57 | -------------------------------------------------------------------------------- /tests/config/0005.json: -------------------------------------------------------------------------------- 1 | { 2 | "valid": false, 3 | "pyproject": "[tool.pccc]\n\nheader_length = 50\nbody_length = 72\nrewrap = true\nspell_check = false\nrepair = false\n\ntypes = [\n \"build\",\n \"docs\",\n \"feat\",\n \"fix\",\n \"refactor\",\n \"test\"\n]\n\nscopes = [\n \"config\",\n \"parser\"\n]\n\nfooters = [\n \"signed-off-by\"\n]\n\nrequired_footers = [\n \"signed-off-by\"\n]\n", 4 | "pccc": { 5 | "header_length": 50, 6 | "body_length": 72, 7 | "rewrap": true, 8 | "spell_check": false, 9 | "repair": false, 10 | "types": [ 11 | "build", 12 | "docs", 13 | "feat", 14 | "fix", 15 | "refactor", 16 | "test" 17 | ], 18 | "scopes": [ 19 | "config", 20 | "parser" 21 | ], 22 | "footers": [ 23 | "signed-off-by" 24 | ], 25 | "required_footers": [ 26 | "signed-off-by" 27 | ] 28 | }, 29 | "cli": [ 30 | "--types", 31 | "" 32 | ], 33 | "config": { 34 | "commit": "-", 35 | "config_file": "./pyproject.toml", 36 | "header_length": 50, 37 | "body_length": 72, 38 | "rewrap": true, 39 | "spell_check": false, 40 | "repair": false, 41 | "types": [ 42 | ], 43 | "scopes": [ 44 | "config", 45 | "parser" 46 | ], 47 | "footers": [ 48 | "signed-off-by" 49 | ], 50 | "required_footers": [ 51 | "signed-off-by" 52 | ] 53 | }, 54 | "str": "[tool.pccc]\n\nheader_length = 50\nbody_length = 72\nrepair = false\nrewrap = true\nspell_check = false\n\ntypes = [\n]\n\nscopes = [\n \"config\",\n \"parser\"\n]\n\nfooters = [\n \"signed-off-by\"\n]\n\nrequired_footers = [\n \"signed-off-by\"\n]\n", 55 | "repr": "Config(commit=\"-\", config_file=\"./pyproject.toml\", header_length=50, body_length=72, repair=False, rewrap=True, spell_check=False, types=[], scopes=['config', 'parser'], footers=['signed-off-by'], required_footers=['signed-off-by'])" 56 | } 57 | -------------------------------------------------------------------------------- /tests/config/0006.json: -------------------------------------------------------------------------------- 1 | { 2 | "valid": false, 3 | "pyproject": "[tool.pccc]\n\nheader_length = 50\nbody_length = 72\nrewrap = true\nspell_check = false\nrepair = false\n\ntypes = [\n \"build\",\n \"docs\",\n \"feat\",\n \"fix\",\n \"refactor\",\n \"test\"\n]\n\nscopes = [\n \"config\",\n \"parser\"\n]\n\nfooters = [\n \"signed-off-by\"\n]\n\nrequired_footers = [\n \"signed-off-by\"\n]\n", 4 | "pccc": { 5 | "header_length": 50, 6 | "body_length": 72, 7 | "rewrap": true, 8 | "spell_check": false, 9 | "repair": false, 10 | "types": [ 11 | "build", 12 | "docs", 13 | "feat", 14 | "fix", 15 | "refactor", 16 | "test" 17 | ], 18 | "scopes": [ 19 | "config", 20 | "parser" 21 | ], 22 | "footers": [ 23 | "signed-off-by" 24 | ], 25 | "required_footers": [ 26 | "signed-off-by" 27 | ] 28 | }, 29 | "cli": [ 30 | "--types", 31 | "build, docs, refactor, test" 32 | ], 33 | "config": { 34 | "commit": "-", 35 | "config_file": "./pyproject.toml", 36 | "header_length": 50, 37 | "body_length": 72, 38 | "rewrap": true, 39 | "spell_check": false, 40 | "repair": false, 41 | "types": [ 42 | "build", 43 | "docs", 44 | "refactor", 45 | "test" 46 | ], 47 | "scopes": [ 48 | "config", 49 | "parser" 50 | ], 51 | "footers": [ 52 | "signed-off-by" 53 | ], 54 | "required_footers": [ 55 | "signed-off-by" 56 | ] 57 | }, 58 | "str": "[tool.pccc]\n\nheader_length = 50\nbody_length = 72\nrepair = false\nrewrap = true\nspell_check = false\n\ntypes = [\n \"build\",\n \"docs\",\n \"refactor\",\n \"test\"\n]\n\nscopes = [\n \"config\",\n \"parser\"\n]\n\nfooters = [\n \"signed-off-by\"\n]\n\nrequired_footers = [\n \"signed-off-by\"\n]\n", 59 | "repr": "Config(commit=\"-\", config_file=\"./pyproject.toml\", header_length=50, body_length=72, repair=False, rewrap=True, spell_check=False, types=['build', 'docs', 'refactor', 'test'], scopes=['config', 'parser'], footers=['signed-off-by'], required_footers=['signed-off-by'])" 60 | } 61 | -------------------------------------------------------------------------------- /tests/config/0007.json: -------------------------------------------------------------------------------- 1 | { 2 | "valid": true, 3 | "pyproject": "[tool.pccc]\n\nheader_length = 50\nbody_length = 72\nrewrap = true\nspell_check = false\nrepair = true\n\ntypes = [\n \"build\",\n \"docs\",\n \"feat\",\n \"fix\",\n \"refactor\",\n \"test\"\n]\n\nscopes = [\n \"config\",\n \"parser\"\n]\n\nfooters = [\n \"signed-off-by\"\n]\n\nrequired_footers = [\n \"signed-off-by\"\n]\n", 4 | "pccc": { 5 | "header_length": 50, 6 | "body_length": 72, 7 | "rewrap": true, 8 | "spell_check": false, 9 | "repair": true, 10 | "types": [ 11 | "build", 12 | "docs", 13 | "feat", 14 | "fix", 15 | "refactor", 16 | "test" 17 | ], 18 | "scopes": [ 19 | "config", 20 | "parser" 21 | ], 22 | "footers": [ 23 | "signed-off-by" 24 | ], 25 | "required_footers": [ 26 | "signed-off-by" 27 | ] 28 | }, 29 | "cli": [ 30 | ], 31 | "config": { 32 | "commit": "-", 33 | "config_file": "./pyproject.toml", 34 | "header_length": 50, 35 | "body_length": 72, 36 | "rewrap": true, 37 | "spell_check": false, 38 | "repair": true, 39 | "types": [ 40 | "build", 41 | "docs", 42 | "feat", 43 | "fix", 44 | "refactor", 45 | "test" 46 | ], 47 | "scopes": [ 48 | "config", 49 | "parser" 50 | ], 51 | "footers": [ 52 | "signed-off-by" 53 | ], 54 | "required_footers": [ 55 | "signed-off-by" 56 | ] 57 | }, 58 | "str": "[tool.pccc]\n\nheader_length = 50\nbody_length = 72\nrepair = true\nrewrap = true\nspell_check = false\n\ntypes = [\n \"build\",\n \"docs\",\n \"feat\",\n \"fix\",\n \"refactor\",\n \"test\"\n]\n\nscopes = [\n \"config\",\n \"parser\"\n]\n\nfooters = [\n \"signed-off-by\"\n]\n\nrequired_footers = [\n \"signed-off-by\"\n]\n", 59 | "repr": "Config(commit=\"-\", config_file=\"./pyproject.toml\", header_length=50, body_length=72, repair=True, rewrap=True, spell_check=False, types=['build', 'docs', 'feat', 'fix', 'refactor', 'test'], scopes=['config', 'parser'], footers=['signed-off-by'], required_footers=['signed-off-by'])" 60 | } 61 | -------------------------------------------------------------------------------- /tests/config/0008.json: -------------------------------------------------------------------------------- 1 | { 2 | "valid": true, 3 | "pyproject": "[tool.pccc]\n\nheader_length = 50\nbody_length = 72\nrewrap = true\nspell_check = true\nrepair = false\n\ntypes = [\n \"build\",\n \"docs\",\n \"feat\",\n \"fix\",\n \"refactor\",\n \"test\"\n]\n\nscopes = [\n \"config\",\n \"parser\"\n]\n\nfooters = [\n \"signed-off-by\"\n]\n\nrequired_footers = [\n \"signed-off-by\"\n]\n", 4 | "pccc": { 5 | "header_length": 50, 6 | "body_length": 72, 7 | "rewrap": true, 8 | "spell_check": true, 9 | "repair": false, 10 | "types": [ 11 | "build", 12 | "docs", 13 | "feat", 14 | "fix", 15 | "refactor", 16 | "test" 17 | ], 18 | "scopes": [ 19 | "config", 20 | "parser" 21 | ], 22 | "footers": [ 23 | "signed-off-by" 24 | ], 25 | "required_footers": [ 26 | "signed-off-by" 27 | ] 28 | }, 29 | "cli": [ 30 | ], 31 | "config": { 32 | "commit": "-", 33 | "config_file": "./pyproject.toml", 34 | "header_length": 50, 35 | "body_length": 72, 36 | "rewrap": true, 37 | "spell_check": true, 38 | "repair": false, 39 | "types": [ 40 | "build", 41 | "docs", 42 | "feat", 43 | "fix", 44 | "refactor", 45 | "test" 46 | ], 47 | "scopes": [ 48 | "config", 49 | "parser" 50 | ], 51 | "footers": [ 52 | "signed-off-by" 53 | ], 54 | "required_footers": [ 55 | "signed-off-by" 56 | ] 57 | }, 58 | "str": "[tool.pccc]\n\nheader_length = 50\nbody_length = 72\nrepair = false\nrewrap = true\nspell_check = true\n\ntypes = [\n \"build\",\n \"docs\",\n \"feat\",\n \"fix\",\n \"refactor\",\n \"test\"\n]\n\nscopes = [\n \"config\",\n \"parser\"\n]\n\nfooters = [\n \"signed-off-by\"\n]\n\nrequired_footers = [\n \"signed-off-by\"\n]\n", 59 | "repr": "Config(commit=\"-\", config_file=\"./pyproject.toml\", header_length=50, body_length=72, repair=False, rewrap=True, spell_check=True, types=['build', 'docs', 'feat', 'fix', 'refactor', 'test'], scopes=['config', 'parser'], footers=['signed-off-by'], required_footers=['signed-off-by'])" 60 | } 61 | -------------------------------------------------------------------------------- /tests/config/0009.json: -------------------------------------------------------------------------------- 1 | { 2 | "valid": true, 3 | "pyproject": "[tool.pccc]\n\nheader_length = 50\nbody_length = 72\nrewrap = false\nspell_check = false\nrepair = false\n\ntypes = [\n \"build\",\n \"docs\",\n \"feat\",\n \"fix\",\n \"refactor\",\n \"test\"\n]\n\nscopes = [\n \"config\",\n \"parser\"\n]\n\nfooters = [\n \"signed-off-by\"\n]\n\nrequired_footers = [\n \"signed-off-by\"\n]\n", 4 | "pccc": { 5 | "header_length": 50, 6 | "body_length": 72, 7 | "rewrap": false, 8 | "spell_check": false, 9 | "repair": false, 10 | "types": [ 11 | "build", 12 | "docs", 13 | "feat", 14 | "fix", 15 | "refactor", 16 | "test" 17 | ], 18 | "scopes": [ 19 | "config", 20 | "parser" 21 | ], 22 | "footers": [ 23 | "signed-off-by" 24 | ], 25 | "required_footers": [ 26 | "signed-off-by" 27 | ] 28 | }, 29 | "cli": [ 30 | ], 31 | "config": { 32 | "commit": "-", 33 | "config_file": "./pyproject.toml", 34 | "header_length": 50, 35 | "body_length": 72, 36 | "rewrap": false, 37 | "spell_check": false, 38 | "repair": false, 39 | "types": [ 40 | "build", 41 | "docs", 42 | "feat", 43 | "fix", 44 | "refactor", 45 | "test" 46 | ], 47 | "scopes": [ 48 | "config", 49 | "parser" 50 | ], 51 | "footers": [ 52 | "signed-off-by" 53 | ], 54 | "required_footers": [ 55 | "signed-off-by" 56 | ] 57 | }, 58 | "str": "[tool.pccc]\n\nheader_length = 50\nbody_length = 72\nrepair = false\nrewrap = false\nspell_check = false\n\ntypes = [\n \"build\",\n \"docs\",\n \"feat\",\n \"fix\",\n \"refactor\",\n \"test\"\n]\n\nscopes = [\n \"config\",\n \"parser\"\n]\n\nfooters = [\n \"signed-off-by\"\n]\n\nrequired_footers = [\n \"signed-off-by\"\n]\n", 59 | "repr": "Config(commit=\"-\", config_file=\"./pyproject.toml\", header_length=50, body_length=72, repair=False, rewrap=False, spell_check=False, types=['build', 'docs', 'feat', 'fix', 'refactor', 'test'], scopes=['config', 'parser'], footers=['signed-off-by'], required_footers=['signed-off-by'])" 60 | } 61 | -------------------------------------------------------------------------------- /tests/config/0010.json: -------------------------------------------------------------------------------- 1 | { 2 | "valid": true, 3 | "pyproject": "[tool.pccc]\n\nheader_length = 50\nbody_length = 72\nrewrap = true\nspell_check = false\nrepair = false\n\ntypes = [\n \"build\",\n \"docs\",\n \"feat\",\n \"fix\",\n \"refactor\",\n \"test\"\n]\n\nscopes = [\n \"config\",\n \"parser\"\n]\n\nfooters = [\n \"signed-off-by\"\n]\n\nrequired_footers = [\n]\n", 4 | "pccc": { 5 | "header_length": 50, 6 | "body_length": 72, 7 | "rewrap": true, 8 | "spell_check": false, 9 | "repair": false, 10 | "types": [ 11 | "build", 12 | "docs", 13 | "feat", 14 | "fix", 15 | "refactor", 16 | "test" 17 | ], 18 | "scopes": [ 19 | "config", 20 | "parser" 21 | ], 22 | "footers": [ 23 | "signed-off-by" 24 | ], 25 | "required_footers": [ 26 | ] 27 | }, 28 | "cli": [ 29 | ], 30 | "config": { 31 | "commit": "-", 32 | "config_file": "./pyproject.toml", 33 | "header_length": 50, 34 | "body_length": 72, 35 | "rewrap": true, 36 | "spell_check": false, 37 | "repair": false, 38 | "types": [ 39 | "build", 40 | "docs", 41 | "feat", 42 | "fix", 43 | "refactor", 44 | "test" 45 | ], 46 | "scopes": [ 47 | "config", 48 | "parser" 49 | ], 50 | "footers": [ 51 | "signed-off-by" 52 | ], 53 | "required_footers": [ 54 | ] 55 | }, 56 | "str": "[tool.pccc]\n\nheader_length = 50\nbody_length = 72\nrepair = false\nrewrap = true\nspell_check = false\n\ntypes = [\n \"build\",\n \"docs\",\n \"feat\",\n \"fix\",\n \"refactor\",\n \"test\"\n]\n\nscopes = [\n \"config\",\n \"parser\"\n]\n\nfooters = [\n \"signed-off-by\"\n]\n\nrequired_footers = [\n]\n", 57 | "repr": "Config(commit=\"-\", config_file=\"./pyproject.toml\", header_length=50, body_length=72, repair=False, rewrap=True, spell_check=False, types=['build', 'docs', 'feat', 'fix', 'refactor', 'test'], scopes=['config', 'parser'], footers=['signed-off-by'], required_footers=[])" 58 | } 59 | -------------------------------------------------------------------------------- /tests/config/0011.json: -------------------------------------------------------------------------------- 1 | { 2 | "valid": true, 3 | "pyproject": "[tool.pccc]\n\nheader_length = 50\nbody_length = 72\nrewrap = true\nspell_check = false\nrepair = false\n\ntypes = [\n \"build\",\n \"docs\",\n \"feat\",\n \"fix\",\n \"refactor\",\n \"test\"\n]\n\nscopes = [\n \"config\",\n \"parser\"\n]\n\nfooters = [\n]\n\nrequired_footers = [\n \"signed-off-by\"\n]\n", 4 | "pccc": { 5 | "header_length": 50, 6 | "body_length": 72, 7 | "rewrap": true, 8 | "spell_check": false, 9 | "repair": false, 10 | "types": [ 11 | "build", 12 | "docs", 13 | "feat", 14 | "fix", 15 | "refactor", 16 | "test" 17 | ], 18 | "scopes": [ 19 | "config", 20 | "parser" 21 | ], 22 | "footers": [ 23 | ], 24 | "required_footers": [ 25 | "signed-off-by" 26 | ] 27 | }, 28 | "cli": [ 29 | ], 30 | "config": { 31 | "commit": "-", 32 | "config_file": "./pyproject.toml", 33 | "header_length": 50, 34 | "body_length": 72, 35 | "rewrap": true, 36 | "spell_check": false, 37 | "repair": false, 38 | "types": [ 39 | "build", 40 | "docs", 41 | "feat", 42 | "fix", 43 | "refactor", 44 | "test" 45 | ], 46 | "scopes": [ 47 | "config", 48 | "parser" 49 | ], 50 | "footers": [ 51 | ], 52 | "required_footers": [ 53 | "signed-off-by" 54 | ] 55 | }, 56 | "str": "[tool.pccc]\n\nheader_length = 50\nbody_length = 72\nrepair = false\nrewrap = true\nspell_check = false\n\ntypes = [\n \"build\",\n \"docs\",\n \"feat\",\n \"fix\",\n \"refactor\",\n \"test\"\n]\n\nscopes = [\n \"config\",\n \"parser\"\n]\n\nfooters = [\n]\n\nrequired_footers = [\n \"signed-off-by\"\n]\n", 57 | "repr": "Config(commit=\"-\", config_file=\"./pyproject.toml\", header_length=50, body_length=72, repair=False, rewrap=True, spell_check=False, types=['build', 'docs', 'feat', 'fix', 'refactor', 'test'], scopes=['config', 'parser'], footers=[], required_footers=['signed-off-by'])" 58 | } 59 | -------------------------------------------------------------------------------- /tests/config/0012.json: -------------------------------------------------------------------------------- 1 | { 2 | "valid": true, 3 | "pyproject": "[tool.pccc]\n\nheader_length = 50\nbody_length = 72\nrewrap = true\nspell_check = false\nrepair = false\n\ntypes = [\n \"build\",\n \"docs\",\n \"feat\",\n \"fix\",\n \"refactor\",\n \"test\"\n]\n\nscopes = [\n]\n\nfooters = [\n \"signed-off-by\"\n]\n\nrequired_footers = [\n \"signed-off-by\"\n]\n", 4 | "pccc": { 5 | "header_length": 50, 6 | "body_length": 72, 7 | "rewrap": true, 8 | "spell_check": false, 9 | "repair": false, 10 | "types": [ 11 | "build", 12 | "docs", 13 | "feat", 14 | "fix", 15 | "refactor", 16 | "test" 17 | ], 18 | "scopes": [ 19 | ], 20 | "footers": [ 21 | "signed-off-by" 22 | ], 23 | "required_footers": [ 24 | "signed-off-by" 25 | ] 26 | }, 27 | "cli": [ 28 | ], 29 | "config": { 30 | "commit": "-", 31 | "config_file": "./pyproject.toml", 32 | "header_length": 50, 33 | "body_length": 72, 34 | "rewrap": true, 35 | "spell_check": false, 36 | "repair": false, 37 | "types": [ 38 | "build", 39 | "docs", 40 | "feat", 41 | "fix", 42 | "refactor", 43 | "test" 44 | ], 45 | "scopes": [ 46 | ], 47 | "footers": [ 48 | "signed-off-by" 49 | ], 50 | "required_footers": [ 51 | "signed-off-by" 52 | ] 53 | }, 54 | "str": "[tool.pccc]\n\nheader_length = 50\nbody_length = 72\nrepair = false\nrewrap = true\nspell_check = false\n\ntypes = [\n \"build\",\n \"docs\",\n \"feat\",\n \"fix\",\n \"refactor\",\n \"test\"\n]\n\nscopes = [\n]\n\nfooters = [\n \"signed-off-by\"\n]\n\nrequired_footers = [\n \"signed-off-by\"\n]\n", 55 | "repr": "Config(commit=\"-\", config_file=\"./pyproject.toml\", header_length=50, body_length=72, repair=False, rewrap=True, spell_check=False, types=['build', 'docs', 'feat', 'fix', 'refactor', 'test'], scopes=[], footers=['signed-off-by'], required_footers=['signed-off-by'])" 56 | } 57 | -------------------------------------------------------------------------------- /tests/config/0013.json: -------------------------------------------------------------------------------- 1 | { 2 | "valid": true, 3 | "pyproject": "[tool.pccc]\n\nheader_length = 50\nbody_length = 72\nrewrap = true\nspell_check = false\nrepair = false\nignore_generated_commits = true\n\ngenerated_commits = [\n\"Merge branch \"\n]\n\ntypes = [\n \"build\",\n \"docs\",\n \"feat\",\n \"fix\",\n \"refactor\",\n \"test\"\n]\n\nscopes = [\n \"config\",\n \"parser\"\n]\n\nfooters = [\n \"signed-off-by\"\n]\n\nrequired_footers = [\n \"signed-off-by\"\n]\n", 4 | "pccc": { 5 | "header_length": 50, 6 | "body_length": 72, 7 | "rewrap": true, 8 | "spell_check": false, 9 | "repair": false, 10 | "ignore_generated_commits": true, 11 | "generated_commits": [ 12 | "Merge branch " 13 | ], 14 | "types": [ 15 | "build", 16 | "docs", 17 | "feat", 18 | "fix", 19 | "refactor", 20 | "test" 21 | ], 22 | "scopes": [ 23 | "config", 24 | "parser" 25 | ], 26 | "footers": [ 27 | "signed-off-by" 28 | ], 29 | "required_footers": [ 30 | "signed-off-by" 31 | ] 32 | }, 33 | "cli": [ 34 | ], 35 | "config": { 36 | "commit": "-", 37 | "config_file": "./pyproject.toml", 38 | "header_length": 50, 39 | "body_length": 72, 40 | "rewrap": true, 41 | "spell_check": false, 42 | "repair": false, 43 | "ignore_generated_commits": true, 44 | "generated_commits": [ 45 | "Merge branch " 46 | ], 47 | "types": [ 48 | "build", 49 | "docs", 50 | "feat", 51 | "fix", 52 | "refactor", 53 | "test" 54 | ], 55 | "scopes": [ 56 | "config", 57 | "parser" 58 | ], 59 | "footers": [ 60 | "signed-off-by" 61 | ], 62 | "required_footers": [ 63 | "signed-off-by" 64 | ] 65 | }, 66 | "str": "[tool.pccc]\n\nheader_length = 50\nbody_length = 72\nrepair = false\nrewrap = true\nspell_check = false\nignore_generated_commits = false\n\ngenerated_commits = [\n]\n\ntypes = [\n \"build\",\n \"docs\",\n \"feat\",\n \"fix\",\n \"refactor\",\n \"test\"\n]\n\nscopes = [\n \"config\",\n \"parser\"\n]\n\nfooters = [\n \"signed-off-by\"\n]\n\nrequired_footers = [\n \"signed-off-by\"\n]\n", 67 | "repr": "Config(commit=\"-\", config_file=\"./pyproject.toml\", header_length=50, body_length=72, repair=False, rewrap=True, spell_check=False, ignore_generated_commits=False, generated_commits=[], types=['build', 'docs', 'feat', 'fix', 'refactor', 'test'], scopes=['config', 'parser'], footers=['signed-off-by'], required_footers=['signed-off-by'])" 68 | } 69 | -------------------------------------------------------------------------------- /tests/config/bad.json: -------------------------------------------------------------------------------- 1 | [tool.pccc] 2 | 3 | header_length = 50 4 | body_length = 72 5 | rewrap = true 6 | spell_check = false 7 | repair = false 8 | 9 | types = [ 10 | "build", 11 | "docs", 12 | "feat", 13 | "fix", 14 | "refactor", 15 | "test" 16 | ] 17 | 18 | scopes = [ 19 | "config", 20 | "parser" 21 | ] 22 | 23 | footers = [ 24 | "signed-off-by" 25 | ] 26 | 27 | required_footers = [ 28 | "signed-off-by" 29 | ] 30 | -------------------------------------------------------------------------------- /tests/parser/0001.json: -------------------------------------------------------------------------------- 1 | { 2 | "raw": "fix: fix parser bug\n\nBREAKING CHANGE: This breaks the old grammar.\n", 3 | "parsed": "fix: fix parser bug\n\nBREAKING CHANGE: This breaks the old grammar.\n", 4 | "header": { 5 | "type": "fix", 6 | "scope": "", 7 | "description": "fix parser bug", 8 | "length": 19 9 | }, 10 | "body": { 11 | "paragraphs": [], 12 | "longest": 0 13 | }, 14 | "breaking": { 15 | "flag": false, 16 | "token": "BREAKING CHANGE", 17 | "separator": ": ", 18 | "value": "This breaks the old grammar.", 19 | "longest": 45 20 | }, 21 | "footers": [], 22 | "cleaned": "fix: fix parser bug\n\nBREAKING CHANGE: This breaks the old grammar.\n", 23 | "parseable": true, 24 | "errors": [] 25 | } 26 | -------------------------------------------------------------------------------- /tests/parser/0002.json: -------------------------------------------------------------------------------- 1 | { 2 | "raw": "fix: fix parser bug\n", 3 | "parsed": "fix: fix parser bug\n", 4 | "header": { 5 | "type": "fix", 6 | "scope": "", 7 | "description": "fix parser bug", 8 | "length": 19 9 | }, 10 | "body": { 11 | "paragraphs": [], 12 | "longest": 0 13 | }, 14 | "breaking": { 15 | "flag": false, 16 | "token": "", 17 | "separator": "", 18 | "value": "", 19 | "longest": 0 20 | }, 21 | "footers": [], 22 | "cleaned": "fix: fix parser bug\n", 23 | "parseable": true, 24 | "errors": [] 25 | } 26 | -------------------------------------------------------------------------------- /tests/parser/0003.json: -------------------------------------------------------------------------------- 1 | { 2 | "raw": "fix(parser): fix parser bug\n", 3 | "parsed": "fix(parser): fix parser bug\n", 4 | "header": { 5 | "type": "fix", 6 | "scope": "parser", 7 | "description": "fix parser bug", 8 | "length": 27 9 | }, 10 | "body": { 11 | "paragraphs": [], 12 | "longest": 0 13 | }, 14 | "breaking": { 15 | "flag": false, 16 | "token": "", 17 | "separator": "", 18 | "value": "", 19 | "longest": 0 20 | }, 21 | "footers": [], 22 | "cleaned": "fix(parser): fix parser bug\n", 23 | "parseable": true, 24 | "errors": [] 25 | } 26 | -------------------------------------------------------------------------------- /tests/parser/0004.json: -------------------------------------------------------------------------------- 1 | { 2 | "raw": "fix!: fix parser bug\n", 3 | "parsed": "fix!: fix parser bug\n", 4 | "header": { 5 | "type": "fix", 6 | "scope": "", 7 | "description": "fix parser bug", 8 | "length": 20 9 | }, 10 | "body": { 11 | "paragraphs": [], 12 | "longest": 0 13 | }, 14 | "breaking": { 15 | "flag": true, 16 | "token": "", 17 | "separator": "", 18 | "value": "", 19 | "longest": 0 20 | }, 21 | "footers": [], 22 | "cleaned": "fix!: fix parser bug\n", 23 | "parseable": true, 24 | "errors": [] 25 | } 26 | -------------------------------------------------------------------------------- /tests/parser/0005.json: -------------------------------------------------------------------------------- 1 | { 2 | "raw": "fix(parser)!: fix parser bug\n", 3 | "parsed": "fix(parser)!: fix parser bug\n", 4 | "header": { 5 | "type": "fix", 6 | "scope": "parser", 7 | "description": "fix parser bug", 8 | "length": 28 9 | }, 10 | "body": { 11 | "paragraphs": [], 12 | "longest": 0 13 | }, 14 | "breaking": { 15 | "flag": true, 16 | "token": "", 17 | "separator": "", 18 | "value": "", 19 | "longest": 0 20 | }, 21 | "footers": [], 22 | "cleaned": "fix(parser)!: fix parser bug\n", 23 | "parseable": true, 24 | "errors": [] 25 | } 26 | -------------------------------------------------------------------------------- /tests/parser/0006.json: -------------------------------------------------------------------------------- 1 | { 2 | "raw": "fix(parser)!: fix parser bug\n\nFix big parser bug. Fix big parser bug. Fix big parser bug. Fix big\nparser bug. Fix big parser bug. Fix big parser bug. Fix big parser\nbug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix\nbig parser bug.\n\nAlso, format your code with black or black, whichever you prefer.\n\nBREAKING CHANGE: This breaks the old grammar.\nSigned-Off-By: Jeremy A Gray \nSigned-Off-By: John Doe \n", 3 | "parsed": "fix(parser)!: fix parser bug\n\nFix big parser bug. Fix big parser bug. Fix big parser bug. Fix big\nparser bug. Fix big parser bug. Fix big parser bug. Fix big parser\nbug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix\nbig parser bug.\n\nAlso, format your code with black or black, whichever you prefer.\n\nBREAKING CHANGE: This breaks the old grammar.\nSigned-off-by: Jeremy A Gray \nSigned-off-by: John Doe \n", 4 | "header": { 5 | "type": "fix", 6 | "scope": "parser", 7 | "description": "fix parser bug", 8 | "length": 28 9 | }, 10 | "body": { 11 | "paragraphs": [ 12 | "Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix big\nparser bug. Fix big parser bug. Fix big parser bug. Fix big parser\nbug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix\nbig parser bug.\n", 13 | "Also, format your code with black or black, whichever you prefer.\n" 14 | ], 15 | "longest": 68 16 | }, 17 | "breaking": { 18 | "flag": true, 19 | "token": "BREAKING CHANGE", 20 | "separator": ": ", 21 | "value": "This breaks the old grammar.", 22 | "longest": 45 23 | }, 24 | "footers": [ 25 | { 26 | "token": "Signed-off-by", 27 | "separator": ": ", 28 | "value": "Jeremy A Gray " 29 | }, 30 | { 31 | "token": "Signed-off-by", 32 | "separator": ": ", 33 | "value": "John Doe " 34 | } 35 | ], 36 | "cleaned": "fix(parser)!: fix parser bug\n\nFix big parser bug. Fix big parser bug. Fix big parser bug. Fix big\nparser bug. Fix big parser bug. Fix big parser bug. Fix big parser\nbug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix\nbig parser bug.\n\nAlso, format your code with black or black, whichever you prefer.\n\nBREAKING CHANGE: This breaks the old grammar.\nSigned-Off-By: Jeremy A Gray \nSigned-Off-By: John Doe \n", 37 | "parseable": true, 38 | "errors": [] 39 | } 40 | -------------------------------------------------------------------------------- /tests/parser/0007.json: -------------------------------------------------------------------------------- 1 | { 2 | "raw": "fix(parser): fix parser bug\n\nBREAKING CHANGE: This breaks the old grammar.\n", 3 | "parsed": "fix(parser): fix parser bug\n\nBREAKING CHANGE: This breaks the old grammar.\n", 4 | "header": { 5 | "type": "fix", 6 | "scope": "parser", 7 | "description": "fix parser bug", 8 | "length": 27 9 | }, 10 | "body": { 11 | "paragraphs": [], 12 | "longest": 0 13 | }, 14 | "breaking": { 15 | "flag": false, 16 | "token": "BREAKING CHANGE", 17 | "separator": ": ", 18 | "value": "This breaks the old grammar.", 19 | "longest": 45 20 | }, 21 | "footers": [], 22 | "cleaned": "fix(parser): fix parser bug\n\nBREAKING CHANGE: This breaks the old grammar.\n", 23 | "parseable": true, 24 | "errors": [] 25 | } 26 | -------------------------------------------------------------------------------- /tests/parser/0008.json: -------------------------------------------------------------------------------- 1 | { 2 | "raw": "fix!: fix parser bug\n\nBREAKING CHANGE: This breaks the old grammar.\n", 3 | "parsed": "fix!: fix parser bug\n\nBREAKING CHANGE: This breaks the old grammar.\n", 4 | "header": { 5 | "type": "fix", 6 | "scope": "", 7 | "description": "fix parser bug", 8 | "length": 20 9 | }, 10 | "body": { 11 | "paragraphs": [], 12 | "longest": 0 13 | }, 14 | "breaking": { 15 | "flag": true, 16 | "token": "BREAKING CHANGE", 17 | "separator": ": ", 18 | "value": "This breaks the old grammar.", 19 | "longest": 45 20 | }, 21 | "footers": [], 22 | "cleaned": "fix!: fix parser bug\n\nBREAKING CHANGE: This breaks the old grammar.\n", 23 | "parseable": true, 24 | "errors": [] 25 | } 26 | -------------------------------------------------------------------------------- /tests/parser/0009.json: -------------------------------------------------------------------------------- 1 | { 2 | "raw": "fix(parser)!: fix parser bug\n\nBREAKING CHANGE: This breaks the old grammar.\n", 3 | "parsed": "fix(parser)!: fix parser bug\n\nBREAKING CHANGE: This breaks the old grammar.\n", 4 | "header": { 5 | "type": "fix", 6 | "scope": "parser", 7 | "description": "fix parser bug", 8 | "length": 28 9 | }, 10 | "body": { 11 | "paragraphs": [], 12 | "longest": 0 13 | }, 14 | "breaking": { 15 | "flag": true, 16 | "token": "BREAKING CHANGE", 17 | "separator": ": ", 18 | "value": "This breaks the old grammar.", 19 | "longest": 45 20 | }, 21 | "footers": [], 22 | "cleaned": "fix(parser)!: fix parser bug\n\nBREAKING CHANGE: This breaks the old grammar.\n", 23 | "parseable": true, 24 | "errors": [] 25 | } 26 | -------------------------------------------------------------------------------- /tests/parser/0010.json: -------------------------------------------------------------------------------- 1 | { 2 | "raw": "fix: fix parser bug\n\nBREAKING-CHANGE: This breaks the old grammar.\n", 3 | "parsed": "fix: fix parser bug\n\nBREAKING-CHANGE: This breaks the old grammar.\n", 4 | "header": { 5 | "type": "fix", 6 | "scope": "", 7 | "description": "fix parser bug", 8 | "length": 19 9 | }, 10 | "body": { 11 | "paragraphs": [], 12 | "longest": 0 13 | }, 14 | "breaking": { 15 | "flag": false, 16 | "token": "BREAKING-CHANGE", 17 | "separator": ": ", 18 | "value": "This breaks the old grammar.", 19 | "longest": 45 20 | }, 21 | "footers": [], 22 | "cleaned": "fix: fix parser bug\n\nBREAKING-CHANGE: This breaks the old grammar.\n", 23 | "parseable": true, 24 | "errors": [] 25 | } 26 | -------------------------------------------------------------------------------- /tests/parser/0011.json: -------------------------------------------------------------------------------- 1 | { 2 | "header": { 3 | "type": "fix", 4 | "scope": "parser", 5 | "description": "fix parser bug", 6 | "length": 27 7 | }, 8 | "body": { 9 | "paragraphs": [], 10 | "longest": 0 11 | }, 12 | "breaking": { 13 | "flag": false, 14 | "token": "BREAKING-CHANGE", 15 | "separator": ": ", 16 | "value": "This breaks the old grammar.", 17 | "longest": 45 18 | }, 19 | "footers": [], 20 | "raw": "fix(parser): fix parser bug\n\nBREAKING-CHANGE: This breaks the old grammar.\n", 21 | "parsed": "fix(parser): fix parser bug\n\nBREAKING-CHANGE: This breaks the old grammar.\n", 22 | "cleaned": "fix(parser): fix parser bug\n\nBREAKING-CHANGE: This breaks the old grammar.\n", 23 | "parseable": true, 24 | "errors": [] 25 | } 26 | -------------------------------------------------------------------------------- /tests/parser/0012.json: -------------------------------------------------------------------------------- 1 | { 2 | "header": { 3 | "type": "fix", 4 | "scope": "", 5 | "description": "fix parser bug", 6 | "length": 20 7 | }, 8 | "body": { 9 | "paragraphs": [], 10 | "longest": 0 11 | }, 12 | "breaking": { 13 | "flag": true, 14 | "token": "BREAKING-CHANGE", 15 | "separator": ": ", 16 | "value": "This breaks the old grammar.", 17 | "longest": 45 18 | }, 19 | "footers": [], 20 | "raw": "fix!: fix parser bug\n\nBREAKING-CHANGE: This breaks the old grammar.\n", 21 | "parsed": "fix!: fix parser bug\n\nBREAKING-CHANGE: This breaks the old grammar.\n", 22 | "cleaned": "fix!: fix parser bug\n\nBREAKING-CHANGE: This breaks the old grammar.\n", 23 | "parseable": true, 24 | "errors": [] 25 | } 26 | -------------------------------------------------------------------------------- /tests/parser/0013.json: -------------------------------------------------------------------------------- 1 | { 2 | "header": { 3 | "type": "fix", 4 | "scope": "parser", 5 | "description": "fix parser bug", 6 | "length": 28 7 | }, 8 | "body": { 9 | "paragraphs": [], 10 | "longest": 0 11 | }, 12 | "breaking": { 13 | "flag": true, 14 | "token": "BREAKING-CHANGE", 15 | "separator": ": ", 16 | "value": "This breaks the old grammar.", 17 | "longest": 45 18 | }, 19 | "footers": [], 20 | "raw": "fix(parser)!: fix parser bug\n\nBREAKING-CHANGE: This breaks the old grammar.\n", 21 | "parsed": "fix(parser)!: fix parser bug\n\nBREAKING-CHANGE: This breaks the old grammar.\n", 22 | "cleaned": "fix(parser)!: fix parser bug\n\nBREAKING-CHANGE: This breaks the old grammar.\n", 23 | "parseable": true, 24 | "errors": [] 25 | } 26 | -------------------------------------------------------------------------------- /tests/parser/0014.json: -------------------------------------------------------------------------------- 1 | { 2 | "header": { 3 | "type": "fix", 4 | "scope": "", 5 | "description": "fix parser bug", 6 | "length": 19 7 | }, 8 | "body": { 9 | "paragraphs": [], 10 | "longest": 0 11 | }, 12 | "breaking": { 13 | "flag": false, 14 | "token": "BREAKING CHANGE", 15 | "separator": " #", 16 | "value": "This breaks the old grammar.", 17 | "longest": 45 18 | }, 19 | "footers": [], 20 | "raw": "fix: fix parser bug\n\nBREAKING CHANGE #This breaks the old grammar.\n", 21 | "parsed": "fix: fix parser bug\n\nBREAKING CHANGE #This breaks the old grammar.\n", 22 | "cleaned": "fix: fix parser bug\n\nBREAKING CHANGE #This breaks the old grammar.\n", 23 | "parseable": true, 24 | "errors": [] 25 | } 26 | -------------------------------------------------------------------------------- /tests/parser/0015.json: -------------------------------------------------------------------------------- 1 | { 2 | "header": { 3 | "type": "fix", 4 | "scope": "parser", 5 | "description": "fix parser bug", 6 | "length": 27 7 | }, 8 | "body": { 9 | "paragraphs": [], 10 | "longest": 0 11 | }, 12 | "breaking": { 13 | "flag": false, 14 | "token": "BREAKING CHANGE", 15 | "separator": " #", 16 | "value": "This breaks the old grammar.", 17 | "longest": 45 18 | }, 19 | "footers": [], 20 | "raw": "fix(parser): fix parser bug\n\nBREAKING CHANGE #This breaks the old grammar.\n", 21 | "parsed": "fix(parser): fix parser bug\n\nBREAKING CHANGE #This breaks the old grammar.\n", 22 | "cleaned": "fix(parser): fix parser bug\n\nBREAKING CHANGE #This breaks the old grammar.\n", 23 | "parseable": true, 24 | "errors": [] 25 | } 26 | -------------------------------------------------------------------------------- /tests/parser/0016.json: -------------------------------------------------------------------------------- 1 | { 2 | "header": { 3 | "type": "fix", 4 | "scope": "", 5 | "description": "fix parser bug", 6 | "length": 20 7 | }, 8 | "body": { 9 | "paragraphs": [], 10 | "longest": 0 11 | }, 12 | "breaking": { 13 | "flag": true, 14 | "token": "BREAKING CHANGE", 15 | "separator": " #", 16 | "value": "This breaks the old grammar.", 17 | "longest": 45 18 | }, 19 | "footers": [], 20 | "raw": "fix!: fix parser bug\n\nBREAKING CHANGE #This breaks the old grammar.\n", 21 | "parsed": "fix!: fix parser bug\n\nBREAKING CHANGE #This breaks the old grammar.\n", 22 | "cleaned": "fix!: fix parser bug\n\nBREAKING CHANGE #This breaks the old grammar.\n", 23 | "parseable": true, 24 | "errors": [] 25 | } 26 | -------------------------------------------------------------------------------- /tests/parser/0017.json: -------------------------------------------------------------------------------- 1 | { 2 | "header": { 3 | "type": "fix", 4 | "scope": "parser", 5 | "description": "fix parser bug", 6 | "length": 28 7 | }, 8 | "body": { 9 | "paragraphs": [], 10 | "longest": 0 11 | }, 12 | "breaking": { 13 | "flag": true, 14 | "token": "BREAKING CHANGE", 15 | "separator": " #", 16 | "value": "This breaks the old grammar.", 17 | "longest": 45 18 | }, 19 | "footers": [], 20 | "raw": "fix(parser)!: fix parser bug\n\nBREAKING CHANGE #This breaks the old grammar.\n", 21 | "parsed": "fix(parser)!: fix parser bug\n\nBREAKING CHANGE #This breaks the old grammar.\n", 22 | "cleaned": "fix(parser)!: fix parser bug\n\nBREAKING CHANGE #This breaks the old grammar.\n", 23 | "parseable": true, 24 | "errors": [] 25 | } 26 | -------------------------------------------------------------------------------- /tests/parser/0018.json: -------------------------------------------------------------------------------- 1 | { 2 | "header": { 3 | "type": "fix", 4 | "scope": "", 5 | "description": "fix parser bug", 6 | "length": 19 7 | }, 8 | "body": { 9 | "paragraphs": [], 10 | "longest": 0 11 | }, 12 | "breaking": { 13 | "flag": false, 14 | "token": "BREAKING-CHANGE", 15 | "separator": " #", 16 | "value": "This breaks the old grammar.", 17 | "longest": 45 18 | }, 19 | "footers": [], 20 | "raw": "fix: fix parser bug\n\nBREAKING-CHANGE #This breaks the old grammar.\n", 21 | "parsed": "fix: fix parser bug\n\nBREAKING-CHANGE #This breaks the old grammar.\n", 22 | "cleaned": "fix: fix parser bug\n\nBREAKING-CHANGE #This breaks the old grammar.\n", 23 | "parseable": true, 24 | "errors": [] 25 | } 26 | -------------------------------------------------------------------------------- /tests/parser/0019.json: -------------------------------------------------------------------------------- 1 | { 2 | "header": { 3 | "type": "fix", 4 | "scope": "parser", 5 | "description": "fix parser bug", 6 | "length": 27 7 | }, 8 | "body": { 9 | "paragraphs": [], 10 | "longest": 0 11 | }, 12 | "breaking": { 13 | "flag": false, 14 | "token": "BREAKING-CHANGE", 15 | "separator": " #", 16 | "value": "This breaks the old grammar.", 17 | "longest": 45 18 | }, 19 | "footers": [], 20 | "raw": "fix(parser): fix parser bug\n\nBREAKING-CHANGE #This breaks the old grammar.\n", 21 | "parsed": "fix(parser): fix parser bug\n\nBREAKING-CHANGE #This breaks the old grammar.\n", 22 | "cleaned": "fix(parser): fix parser bug\n\nBREAKING-CHANGE #This breaks the old grammar.\n", 23 | "parseable": true, 24 | "errors": [] 25 | } 26 | -------------------------------------------------------------------------------- /tests/parser/0020.json: -------------------------------------------------------------------------------- 1 | { 2 | "header": { 3 | "type": "fix", 4 | "scope": "", 5 | "description": "fix parser bug", 6 | "length": 20 7 | }, 8 | "body": { 9 | "paragraphs": [], 10 | "longest": 0 11 | }, 12 | "breaking": { 13 | "flag": true, 14 | "token": "BREAKING-CHANGE", 15 | "separator": " #", 16 | "value": "This breaks the old grammar.", 17 | "longest": 45 18 | }, 19 | "footers": [], 20 | "raw": "fix!: fix parser bug\n\nBREAKING-CHANGE #This breaks the old grammar.\n", 21 | "parsed": "fix!: fix parser bug\n\nBREAKING-CHANGE #This breaks the old grammar.\n", 22 | "cleaned": "fix!: fix parser bug\n\nBREAKING-CHANGE #This breaks the old grammar.\n", 23 | "parseable": true, 24 | "errors": [] 25 | } 26 | -------------------------------------------------------------------------------- /tests/parser/0021.json: -------------------------------------------------------------------------------- 1 | { 2 | "header": { 3 | "type": "fix", 4 | "scope": "parser", 5 | "description": "fix parser bug", 6 | "length": 28 7 | }, 8 | "body": { 9 | "paragraphs": [], 10 | "longest": 0 11 | }, 12 | "breaking": { 13 | "flag": true, 14 | "token": "BREAKING-CHANGE", 15 | "separator": " #", 16 | "value": "This breaks the old grammar.", 17 | "longest": 45 18 | }, 19 | "footers": [], 20 | "raw": "fix(parser)!: fix parser bug\n\nBREAKING-CHANGE #This breaks the old grammar.\n", 21 | "parsed": "fix(parser)!: fix parser bug\n\nBREAKING-CHANGE #This breaks the old grammar.\n", 22 | "cleaned": "fix(parser)!: fix parser bug\n\nBREAKING-CHANGE #This breaks the old grammar.\n", 23 | "parseable": true, 24 | "errors": [] 25 | } 26 | -------------------------------------------------------------------------------- /tests/parser/0022.json: -------------------------------------------------------------------------------- 1 | { 2 | "header": { 3 | "type": "fix", 4 | "scope": "parser", 5 | "description": "fix parser bug", 6 | "length": 28 7 | }, 8 | "body": { 9 | "paragraphs": [ 10 | "Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix big\nparser bug. Fix big parser bug. Fix big parser bug. Fix big parser\nbug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix\nbig parser bug.\n", 11 | "Also, format your code with black or black, whichever you prefer.\n" 12 | ], 13 | "longest": 68 14 | }, 15 | "breaking": { 16 | "flag": true, 17 | "token": "BREAKING CHANGE", 18 | "separator": ": ", 19 | "value": "This breaks the old grammar. This breaks the old grammar. This breaks the old grammar. This breaks the old grammar. This breaks the old grammar. This breaks the old grammar.", 20 | "longest": 195 21 | }, 22 | "footers": [ 23 | { 24 | "token": "Signed-off-by", 25 | "separator": ": ", 26 | "value": "Jeremy A Gray " 27 | }, 28 | { 29 | "token": "Signed-off-by", 30 | "separator": ": ", 31 | "value": "John Doe " 32 | } 33 | ], 34 | "raw": "fix(parser)!: fix parser bug\n\nFix big parser bug. Fix big parser bug. Fix big parser bug. Fix big\nparser bug. Fix big parser bug. Fix big parser bug. Fix big parser\nbug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix\nbig parser bug.\n\nAlso, format your code with black or black, whichever you prefer.\n\nBREAKING CHANGE: This breaks the old grammar. This breaks the old grammar. This breaks the old grammar. This breaks the old grammar. This breaks the old grammar. This breaks the old grammar.\nSigned-Off-By: Jeremy A Gray \nSigned-Off-By: John Doe \n", 35 | "parsed": "fix(parser)!: fix parser bug\n\nFix big parser bug. Fix big parser bug. Fix big parser bug. Fix big\nparser bug. Fix big parser bug. Fix big parser bug. Fix big parser\nbug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix\nbig parser bug.\n\nAlso, format your code with black or black, whichever you prefer.\n\nBREAKING CHANGE: This breaks the old grammar. This breaks the old grammar. This breaks the old grammar. This breaks the old grammar. This breaks the old grammar. This breaks the old grammar.\nSigned-off-by: Jeremy A Gray \nSigned-off-by: John Doe \n", 36 | "cleaned": "fix(parser)!: fix parser bug\n\nFix big parser bug. Fix big parser bug. Fix big parser bug. Fix big\nparser bug. Fix big parser bug. Fix big parser bug. Fix big parser\nbug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix\nbig parser bug.\n\nAlso, format your code with black or black, whichever you prefer.\n\nBREAKING CHANGE: This breaks the old grammar. This breaks the old grammar. This breaks the old grammar. This breaks the old grammar. This breaks the old grammar. This breaks the old grammar.\nSigned-Off-By: Jeremy A Gray \nSigned-Off-By: John Doe \n", 37 | "parseable": true, 38 | "errors": [] 39 | } 40 | -------------------------------------------------------------------------------- /tests/parser/0023.json: -------------------------------------------------------------------------------- 1 | { 2 | "header": { 3 | "type": "fix", 4 | "scope": "parser", 5 | "description": "fix parser bug", 6 | "length": 28 7 | }, 8 | "body": { 9 | "paragraphs": [ 10 | "Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix big\nparser bug. Fix big parser bug. Fix big parser bug. Fix big parser\nbug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix\nbig parser bug.\n", 11 | "Also, format your code with black or black, whichever you prefer.\n" 12 | ], 13 | "longest": 68 14 | }, 15 | "breaking": { 16 | "flag": true, 17 | "token": "BREAKING CHANGE", 18 | "separator": ": ", 19 | "value": "This breaks the old grammar. This breaks the old\ngrammar. This breaks the old grammar. This breaks the old grammar.\nThis breaks the old grammar. This breaks the old grammar.", 20 | "longest": 68 21 | }, 22 | "footers": [ 23 | { 24 | "token": "Signed-off-by", 25 | "separator": ": ", 26 | "value": "Jeremy A Gray " 27 | }, 28 | { 29 | "token": "Signed-off-by", 30 | "separator": ": ", 31 | "value": "John Doe " 32 | } 33 | ], 34 | "raw": "fix(parser)!: fix parser bug\n\nFix big parser bug. Fix big parser bug. Fix big parser bug. Fix big\nparser bug. Fix big parser bug. Fix big parser bug. Fix big parser\nbug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix\nbig parser bug.\n\nAlso, format your code with black or black, whichever you prefer.\n\nBREAKING CHANGE: This breaks the old grammar. This breaks the old\ngrammar. This breaks the old grammar. This breaks the old grammar.\nThis breaks the old grammar. This breaks the old grammar.\nSigned-Off-By: Jeremy A Gray \nSigned-Off-By: John Doe \n", 35 | "parsed": "fix(parser)!: fix parser bug\n\nFix big parser bug. Fix big parser bug. Fix big parser bug. Fix big\nparser bug. Fix big parser bug. Fix big parser bug. Fix big parser\nbug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix\nbig parser bug.\n\nAlso, format your code with black or black, whichever you prefer.\n\nBREAKING CHANGE: This breaks the old grammar. This breaks the old\ngrammar. This breaks the old grammar. This breaks the old grammar.\nThis breaks the old grammar. This breaks the old grammar.\nSigned-off-by: Jeremy A Gray \nSigned-off-by: John Doe \n", 36 | "cleaned": "fix(parser)!: fix parser bug\n\nFix big parser bug. Fix big parser bug. Fix big parser bug. Fix big\nparser bug. Fix big parser bug. Fix big parser bug. Fix big parser\nbug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix\nbig parser bug.\n\nAlso, format your code with black or black, whichever you prefer.\n\nBREAKING CHANGE: This breaks the old grammar. This breaks the old\ngrammar. This breaks the old grammar. This breaks the old grammar.\nThis breaks the old grammar. This breaks the old grammar.\nSigned-Off-By: Jeremy A Gray \nSigned-Off-By: John Doe \n", 37 | "parseable": true, 38 | "errors": [] 39 | } 40 | -------------------------------------------------------------------------------- /tests/parser/0024.json: -------------------------------------------------------------------------------- 1 | { 2 | "header": { 3 | "type": "fix", 4 | "scope": "parser", 5 | "description": "fix parser bug", 6 | "length": 28 7 | }, 8 | "body": { 9 | "paragraphs": [ 10 | "Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix big\nparser bug. Fix big parser bug. Fix big parser bug. Fix big parser\nbug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix\nbig parser bug.\n", 11 | "Also, format your code with black or black, whichever you prefer.\n" 12 | ], 13 | "longest": 68 14 | }, 15 | "breaking": { 16 | "flag": true, 17 | "token": "BREAKING CHANGE", 18 | "separator": ": ", 19 | "value": "This breaks the old grammar.", 20 | "longest": 45 21 | }, 22 | "footers": [ 23 | { 24 | "token": "Signed-off-by", 25 | "separator": ": ", 26 | "value": "Jeremy A Gray " 27 | }, 28 | { 29 | "token": "Signed-off-by", 30 | "separator": ": ", 31 | "value": "John Doe , John Doe , John Doe , John Doe , John Doe , John Doe , John Doe " 32 | } 33 | ], 34 | "raw": "fix(parser)!: fix parser bug\n\nFix big parser bug. Fix big parser bug. Fix big parser bug. Fix big\nparser bug. Fix big parser bug. Fix big parser bug. Fix big parser\nbug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix\nbig parser bug.\n\nAlso, format your code with black or black, whichever you prefer.\n\nBREAKING CHANGE: This breaks the old grammar.\nSigned-Off-By: Jeremy A Gray \nSigned-Off-By: John Doe , John Doe , John Doe , John Doe , John Doe , John Doe , John Doe \n", 35 | "parsed": "fix(parser)!: fix parser bug\n\nFix big parser bug. Fix big parser bug. Fix big parser bug. Fix big\nparser bug. Fix big parser bug. Fix big parser bug. Fix big parser\nbug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix\nbig parser bug.\n\nAlso, format your code with black or black, whichever you prefer.\n\nBREAKING CHANGE: This breaks the old grammar.\nSigned-off-by: Jeremy A Gray \nSigned-off-by: John Doe , John Doe , John Doe , John Doe , John Doe , John Doe , John Doe \n", 36 | "cleaned": "fix(parser)!: fix parser bug\n\nFix big parser bug. Fix big parser bug. Fix big parser bug. Fix big\nparser bug. Fix big parser bug. Fix big parser bug. Fix big parser\nbug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix\nbig parser bug.\n\nAlso, format your code with black or black, whichever you prefer.\n\nBREAKING CHANGE: This breaks the old grammar.\nSigned-Off-By: Jeremy A Gray \nSigned-Off-By: John Doe , John Doe , John Doe , John Doe , John Doe , John Doe , John Doe \n", 37 | "parseable": true, 38 | "errors": [] 39 | } 40 | -------------------------------------------------------------------------------- /tests/parser/0025.json: -------------------------------------------------------------------------------- 1 | { 2 | "header": { 3 | "type": "fix", 4 | "scope": "parser", 5 | "description": "fix parser bug", 6 | "length": 28 7 | }, 8 | "body": { 9 | "paragraphs": [ 10 | "Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix big\nparser bug. Fix big parser bug. Fix big parser bug. Fix big parser\nbug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix\nbig parser bug.\n", 11 | "Also, format your code with black or black, whichever you prefer.\n" 12 | ], 13 | "longest": 68 14 | }, 15 | "breaking": { 16 | "flag": true, 17 | "token": "BREAKING CHANGE", 18 | "separator": ": ", 19 | "value": "This breaks the old grammar.", 20 | "longest": 45 21 | }, 22 | "footers": [ 23 | { 24 | "token": "Signed-off-by", 25 | "separator": ": ", 26 | "value": "Jeremy A Gray " 27 | }, 28 | { 29 | "token": "Signed-off-by", 30 | "separator": ": ", 31 | "value": "John Doe , John Doe\n, John Doe , John Doe\n, John Doe , John Doe\n, John Doe " 32 | } 33 | ], 34 | "raw": "fix(parser)!: fix parser bug\n\nFix big parser bug. Fix big parser bug. Fix big parser bug. Fix big\nparser bug. Fix big parser bug. Fix big parser bug. Fix big parser\nbug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix\nbig parser bug.\n\nAlso, format your code with black or black, whichever you prefer.\n\nBREAKING CHANGE: This breaks the old grammar.\nSigned-Off-By: Jeremy A Gray \nSigned-Off-By: John Doe , John Doe\n, John Doe , John Doe\n, John Doe , John Doe\n, John Doe \n", 35 | "parsed": "fix(parser)!: fix parser bug\n\nFix big parser bug. Fix big parser bug. Fix big parser bug. Fix big\nparser bug. Fix big parser bug. Fix big parser bug. Fix big parser\nbug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix\nbig parser bug.\n\nAlso, format your code with black or black, whichever you prefer.\n\nBREAKING CHANGE: This breaks the old grammar.\nSigned-off-by: Jeremy A Gray \nSigned-off-by: John Doe , John Doe\n, John Doe , John Doe\n, John Doe , John Doe\n, John Doe \n", 36 | "cleaned": "fix(parser)!: fix parser bug\n\nFix big parser bug. Fix big parser bug. Fix big parser bug. Fix big\nparser bug. Fix big parser bug. Fix big parser bug. Fix big parser\nbug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix\nbig parser bug.\n\nAlso, format your code with black or black, whichever you prefer.\n\nBREAKING CHANGE: This breaks the old grammar.\nSigned-Off-By: Jeremy A Gray \nSigned-Off-By: John Doe , John Doe\n, John Doe , John Doe\n, John Doe , John Doe\n, John Doe \n", 37 | "parseable": true, 38 | "errors": [] 39 | } 40 | -------------------------------------------------------------------------------- /tests/parser/0026.json: -------------------------------------------------------------------------------- 1 | { 2 | "header": { 3 | "type": "fix", 4 | "scope": "parser", 5 | "description": "fix parser bug", 6 | "length": 28 7 | }, 8 | "body": { 9 | "paragraphs": [ 10 | "Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix big\nparser bug. Fix big parser bug. Fix big parser bug. Fix big parser\nbug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix\nbig parser bug.\n", 11 | "Also, format your code with black or black, whichever you prefer.\n" 12 | ], 13 | "longest": 68 14 | }, 15 | "breaking": { 16 | "flag": true, 17 | "token": "BREAKING CHANGE", 18 | "separator": ": ", 19 | "value": "This breaks the old grammar.", 20 | "longest": 45 21 | }, 22 | "footers": [ 23 | { 24 | "token": "Signed-off-by", 25 | "separator": ": ", 26 | "value": "John Doe , John Doe\n, John Doe , John Doe\n, John Doe , John Doe\n, John Doe " 27 | }, 28 | { 29 | "token": "Signed-off-by", 30 | "separator": ": ", 31 | "value": "Jeremy A Gray " 32 | } 33 | ], 34 | "raw": "fix(parser)!: fix parser bug\n\nFix big parser bug. Fix big parser bug. Fix big parser bug. Fix big\nparser bug. Fix big parser bug. Fix big parser bug. Fix big parser\nbug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix\nbig parser bug.\n\nAlso, format your code with black or black, whichever you prefer.\n\nBREAKING CHANGE: This breaks the old grammar.\nSigned-Off-By: John Doe , John Doe\n, John Doe , John Doe\n, John Doe , John Doe\n, John Doe \nSigned-Off-By: Jeremy A Gray \n", 35 | "parsed": "fix(parser)!: fix parser bug\n\nFix big parser bug. Fix big parser bug. Fix big parser bug. Fix big\nparser bug. Fix big parser bug. Fix big parser bug. Fix big parser\nbug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix\nbig parser bug.\n\nAlso, format your code with black or black, whichever you prefer.\n\nBREAKING CHANGE: This breaks the old grammar.\nSigned-off-by: John Doe , John Doe\n, John Doe , John Doe\n, John Doe , John Doe\n, John Doe \nSigned-off-by: Jeremy A Gray \n", 36 | "cleaned": "fix(parser)!: fix parser bug\n\nFix big parser bug. Fix big parser bug. Fix big parser bug. Fix big\nparser bug. Fix big parser bug. Fix big parser bug. Fix big parser\nbug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix\nbig parser bug.\n\nAlso, format your code with black or black, whichever you prefer.\n\nBREAKING CHANGE: This breaks the old grammar.\nSigned-Off-By: John Doe , John Doe\n, John Doe , John Doe\n, John Doe , John Doe\n, John Doe \nSigned-Off-By: Jeremy A Gray \n", 37 | "parseable": true, 38 | "errors": [] 39 | } 40 | -------------------------------------------------------------------------------- /tests/parser/0027.json: -------------------------------------------------------------------------------- 1 | { 2 | "header": { 3 | "type": "fix", 4 | "scope": "parser", 5 | "description": "fix parser bug", 6 | "length": 28 7 | }, 8 | "body": { 9 | "paragraphs": [ 10 | "Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix big\nparser bug. Fix big parser bug. Fix big parser bug. Fix big parser\nbug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix\nbig parser bug.\n", 11 | "Also, format your code with black or black, whichever you prefer.\n" 12 | ], 13 | "longest": 68 14 | }, 15 | "breaking": { 16 | "flag": true, 17 | "token": "BREAKING CHANGE", 18 | "separator": ": ", 19 | "value": "This breaks the old grammar.", 20 | "longest": 45 21 | }, 22 | "footers": [ 23 | { 24 | "token": "Signed-off-by", 25 | "separator": ": ", 26 | "value": "John Doe , John Doe\n, John Doe , John Doe\n, John Doe , John Doe\n, John Doe " 27 | }, 28 | { 29 | "token": "Signed-off-by", 30 | "separator": ": ", 31 | "value": "Jeremy A Gray , Jeremy A Gray\n, Jeremy A Gray ,\nJeremy A Gray , Jeremy A Gray\n, Jeremy A Gray " 32 | } 33 | ], 34 | "raw": "fix(parser)!: fix parser bug\n\nFix big parser bug. Fix big parser bug. Fix big parser bug. Fix big\nparser bug. Fix big parser bug. Fix big parser bug. Fix big parser\nbug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix\nbig parser bug.\n\nAlso, format your code with black or black, whichever you prefer.\n\nBREAKING CHANGE: This breaks the old grammar.\nSigned-Off-By: John Doe , John Doe\n, John Doe , John Doe\n, John Doe , John Doe\n, John Doe \nSigned-Off-By: Jeremy A Gray , Jeremy A Gray\n, Jeremy A Gray ,\nJeremy A Gray , Jeremy A Gray\n, Jeremy A Gray \n", 35 | "parsed": "fix(parser)!: fix parser bug\n\nFix big parser bug. Fix big parser bug. Fix big parser bug. Fix big\nparser bug. Fix big parser bug. Fix big parser bug. Fix big parser\nbug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix\nbig parser bug.\n\nAlso, format your code with black or black, whichever you prefer.\n\nBREAKING CHANGE: This breaks the old grammar.\nSigned-off-by: John Doe , John Doe\n, John Doe , John Doe\n, John Doe , John Doe\n, John Doe \nSigned-off-by: Jeremy A Gray , Jeremy A Gray\n, Jeremy A Gray ,\nJeremy A Gray , Jeremy A Gray\n, Jeremy A Gray \n", 36 | "cleaned": "fix(parser)!: fix parser bug\n\nFix big parser bug. Fix big parser bug. Fix big parser bug. Fix big\nparser bug. Fix big parser bug. Fix big parser bug. Fix big parser\nbug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix\nbig parser bug.\n\nAlso, format your code with black or black, whichever you prefer.\n\nBREAKING CHANGE: This breaks the old grammar.\nSigned-Off-By: John Doe , John Doe\n, John Doe , John Doe\n, John Doe , John Doe\n, John Doe \nSigned-Off-By: Jeremy A Gray , Jeremy A Gray\n, Jeremy A Gray ,\nJeremy A Gray , Jeremy A Gray\n, Jeremy A Gray \n", 37 | "parseable": true, 38 | "errors": [] 39 | } 40 | -------------------------------------------------------------------------------- /tests/parser/0028.json: -------------------------------------------------------------------------------- 1 | { 2 | "header": { 3 | "type": "fix", 4 | "scope": "parser", 5 | "description": "fix parser bug", 6 | "length": 28 7 | }, 8 | "body": { 9 | "paragraphs": [ 10 | "Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix big\nparser bug. Fix big parser bug. Fix big parser bug. Fix big parser\nbug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix\nbig parser bug.\n", 11 | "Also, format your code with black or black, whichever you prefer.\n" 12 | ], 13 | "longest": 68 14 | }, 15 | "breaking": { 16 | "flag": true, 17 | "token": "BREAKING CHANGE", 18 | "separator": ": ", 19 | "value": "This breaks the old grammar. This breaks the old\ngrammar. This breaks the old grammar. This breaks the old grammar.\nThis breaks the old grammar. This breaks the old grammar. This\nbreaks the old grammar. This breaks the old grammar.", 20 | "longest": 68 21 | }, 22 | "footers": [ 23 | { 24 | "token": "Signed-off-by", 25 | "separator": ": ", 26 | "value": "John Doe , John Doe\n, John Doe , John Doe\n, John Doe , John Doe\n, John Doe " 27 | }, 28 | { 29 | "token": "Signed-off-by", 30 | "separator": ": ", 31 | "value": "Jeremy A Gray , Jeremy A Gray\n, Jeremy A Gray ,\nJeremy A Gray , Jeremy A Gray\n, Jeremy A Gray " 32 | } 33 | ], 34 | "raw": "fix(parser)!: fix parser bug\n\nFix big parser bug. Fix big parser bug. Fix big parser bug. Fix big\nparser bug. Fix big parser bug. Fix big parser bug. Fix big parser\nbug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix\nbig parser bug.\n\nAlso, format your code with black or black, whichever you prefer.\n\nBREAKING CHANGE: This breaks the old grammar. This breaks the old\ngrammar. This breaks the old grammar. This breaks the old grammar.\nThis breaks the old grammar. This breaks the old grammar. This\nbreaks the old grammar. This breaks the old grammar.\nSigned-Off-By: John Doe , John Doe\n, John Doe , John Doe\n, John Doe , John Doe\n, John Doe \nSigned-Off-By: Jeremy A Gray , Jeremy A Gray\n, Jeremy A Gray ,\nJeremy A Gray , Jeremy A Gray\n, Jeremy A Gray \n", 35 | "parsed": "fix(parser)!: fix parser bug\n\nFix big parser bug. Fix big parser bug. Fix big parser bug. Fix big\nparser bug. Fix big parser bug. Fix big parser bug. Fix big parser\nbug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix\nbig parser bug.\n\nAlso, format your code with black or black, whichever you prefer.\n\nBREAKING CHANGE: This breaks the old grammar. This breaks the old\ngrammar. This breaks the old grammar. This breaks the old grammar.\nThis breaks the old grammar. This breaks the old grammar. This\nbreaks the old grammar. This breaks the old grammar.\nSigned-off-by: John Doe , John Doe\n, John Doe , John Doe\n, John Doe , John Doe\n, John Doe \nSigned-off-by: Jeremy A Gray , Jeremy A Gray\n, Jeremy A Gray ,\nJeremy A Gray , Jeremy A Gray\n, Jeremy A Gray \n", 36 | "cleaned": "fix(parser)!: fix parser bug\n\nFix big parser bug. Fix big parser bug. Fix big parser bug. Fix big\nparser bug. Fix big parser bug. Fix big parser bug. Fix big parser\nbug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix\nbig parser bug.\n\nAlso, format your code with black or black, whichever you prefer.\n\nBREAKING CHANGE: This breaks the old grammar. This breaks the old\ngrammar. This breaks the old grammar. This breaks the old grammar.\nThis breaks the old grammar. This breaks the old grammar. This\nbreaks the old grammar. This breaks the old grammar.\nSigned-Off-By: John Doe , John Doe\n, John Doe , John Doe\n, John Doe , John Doe\n, John Doe \nSigned-Off-By: Jeremy A Gray , Jeremy A Gray\n, Jeremy A Gray ,\nJeremy A Gray , Jeremy A Gray\n, Jeremy A Gray \n", 37 | "parseable": true, 38 | "errors": [] 39 | } 40 | -------------------------------------------------------------------------------- /tests/parser/0029.json: -------------------------------------------------------------------------------- 1 | { 2 | "raw": "fix(parser)!: fix parser bug\n\nFix big parser bug. Fix big parser bug. Fix big parser bug. Fix big\nparser bug. Fix big parser bug. Fix big parser bug. Fix big parser\nbug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix\nbig parser bug.\n\nAlso, format your code with black or black, whichever you prefer.\n\nBREAKING CHANGE: This breaks the old grammar. This breaks the old\ngrammar. This breaks the old grammar. This breaks the old grammar.\nThis breaks the old grammar. This breaks the old grammar. This\nbreaks the old grammar. This breaks the old grammar.\nSigned-Off-By: John Doe , John Doe\n, John Doe , John Doe\n, John Doe , John Doe\n, John Doe \nSigned-Off-By: Jeremy A Gray , Jeremy A Gray\n, Jeremy A Gray ,\nJeremy A Gray , Jeremy A Gray\n, Jeremy A Gray \n# This is a comment line that should be ignored.\n# This is a comment line that should be ignored.\n# This is a comment line that should be ignored. This is a comment line that should be ignored. This is a comment line that should be ignored.\n", 3 | "parsed": "fix(parser)!: fix parser bug\n\nFix big parser bug. Fix big parser bug. Fix big parser bug. Fix big\nparser bug. Fix big parser bug. Fix big parser bug. Fix big parser\nbug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix\nbig parser bug.\n\nAlso, format your code with black or black, whichever you prefer.\n\nBREAKING CHANGE: This breaks the old grammar. This breaks the old\ngrammar. This breaks the old grammar. This breaks the old grammar.\nThis breaks the old grammar. This breaks the old grammar. This\nbreaks the old grammar. This breaks the old grammar.\nSigned-off-by: John Doe , John Doe\n, John Doe , John Doe\n, John Doe , John Doe\n, John Doe \nSigned-off-by: Jeremy A Gray , Jeremy A Gray\n, Jeremy A Gray ,\nJeremy A Gray , Jeremy A Gray\n, Jeremy A Gray \n", 4 | "header": { 5 | "type": "fix", 6 | "scope": "parser", 7 | "description": "fix parser bug", 8 | "length": 28 9 | }, 10 | "body": { 11 | "paragraphs": [ 12 | "Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix big\nparser bug. Fix big parser bug. Fix big parser bug. Fix big parser\nbug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix\nbig parser bug.\n", 13 | "Also, format your code with black or black, whichever you prefer.\n" 14 | ], 15 | "longest": 68 16 | }, 17 | "breaking": { 18 | "flag": true, 19 | "token": "BREAKING CHANGE", 20 | "separator": ": ", 21 | "value": "This breaks the old grammar. This breaks the old\ngrammar. This breaks the old grammar. This breaks the old grammar.\nThis breaks the old grammar. This breaks the old grammar. This\nbreaks the old grammar. This breaks the old grammar.", 22 | "longest": 68 23 | }, 24 | "footers": [ 25 | { 26 | "token": "Signed-off-by", 27 | "separator": ": ", 28 | "value": "John Doe , John Doe\n, John Doe , John Doe\n, John Doe , John Doe\n, John Doe " 29 | }, 30 | { 31 | "token": "Signed-off-by", 32 | "separator": ": ", 33 | "value": "Jeremy A Gray , Jeremy A Gray\n, Jeremy A Gray ,\nJeremy A Gray , Jeremy A Gray\n, Jeremy A Gray " 34 | } 35 | ], 36 | "cleaned": "fix(parser)!: fix parser bug\n\nFix big parser bug. Fix big parser bug. Fix big parser bug. Fix big\nparser bug. Fix big parser bug. Fix big parser bug. Fix big parser\nbug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix\nbig parser bug.\n\nAlso, format your code with black or black, whichever you prefer.\n\nBREAKING CHANGE: This breaks the old grammar. This breaks the old\ngrammar. This breaks the old grammar. This breaks the old grammar.\nThis breaks the old grammar. This breaks the old grammar. This\nbreaks the old grammar. This breaks the old grammar.\nSigned-Off-By: John Doe , John Doe\n, John Doe , John Doe\n, John Doe , John Doe\n, John Doe \nSigned-Off-By: Jeremy A Gray , Jeremy A Gray\n, Jeremy A Gray ,\nJeremy A Gray , Jeremy A Gray\n, Jeremy A Gray \n# This is a comment line that should be ignored.\n# This is a comment line that should be ignored.\n# This is a comment line that should be ignored. This is a comment line that should be ignored. This is a comment line that should be ignored.\n", 37 | "parseable": true, 38 | "errors": [] 39 | } 40 | -------------------------------------------------------------------------------- /tests/parser/0030.json: -------------------------------------------------------------------------------- 1 | { 2 | "raw": "fix(parser)!: fix parser bug\n\nFix big parser bug. Fix big parser bug. Fix big parser bug. Fix big\nparser bug. Fix big parser bug. Fix big parser bug. Fix big parser\nbug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix\nbig parser bug.\n\nAlso, format your code with black or black, whichever you prefer.\n\nBREAKING CHANGE: This breaks the old grammar. This breaks the old\ngrammar. This breaks the old grammar. This breaks the old grammar.\nThis breaks the old grammar. This breaks the old grammar. This\nbreaks the old grammar. This breaks the old grammar.\nSigned-Off-By: John Doe , John Doe\n, John Doe , John Doe\n, John Doe , John Doe\n, John Doe \n# This is a comment line that should be ignored.\nSigned-Off-By: Jeremy A Gray , Jeremy A Gray\n, Jeremy A Gray ,\nJeremy A Gray , Jeremy A Gray\n, Jeremy A Gray \n# This is a comment line that should be ignored.\n# This is a comment line that should be ignored. This is a comment line that should be ignored. This is a comment line that should be ignored.\n", 3 | "parsed": "fix(parser)!: fix parser bug\n\nFix big parser bug. Fix big parser bug. Fix big parser bug. Fix big\nparser bug. Fix big parser bug. Fix big parser bug. Fix big parser\nbug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix\nbig parser bug.\n\nAlso, format your code with black or black, whichever you prefer.\n\nBREAKING CHANGE: This breaks the old grammar. This breaks the old\ngrammar. This breaks the old grammar. This breaks the old grammar.\nThis breaks the old grammar. This breaks the old grammar. This\nbreaks the old grammar. This breaks the old grammar.\nSigned-off-by: John Doe , John Doe\n, John Doe , John Doe\n, John Doe , John Doe\n, John Doe \nSigned-off-by: Jeremy A Gray , Jeremy A Gray\n, Jeremy A Gray ,\nJeremy A Gray , Jeremy A Gray\n, Jeremy A Gray \n", 4 | "header": { 5 | "type": "fix", 6 | "scope": "parser", 7 | "description": "fix parser bug", 8 | "length": 28 9 | }, 10 | "body": { 11 | "paragraphs": [ 12 | "Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix big\nparser bug. Fix big parser bug. Fix big parser bug. Fix big parser\nbug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix\nbig parser bug.\n", 13 | "Also, format your code with black or black, whichever you prefer.\n" 14 | ], 15 | "longest": 68 16 | }, 17 | "breaking": { 18 | "flag": true, 19 | "token": "BREAKING CHANGE", 20 | "separator": ": ", 21 | "value": "This breaks the old grammar. This breaks the old\ngrammar. This breaks the old grammar. This breaks the old grammar.\nThis breaks the old grammar. This breaks the old grammar. This\nbreaks the old grammar. This breaks the old grammar.", 22 | "longest": 68 23 | }, 24 | "footers": [ 25 | { 26 | "token": "Signed-off-by", 27 | "separator": ": ", 28 | "value": "John Doe , John Doe\n, John Doe , John Doe\n, John Doe , John Doe\n, John Doe " 29 | }, 30 | { 31 | "token": "Signed-off-by", 32 | "separator": ": ", 33 | "value": "Jeremy A Gray , Jeremy A Gray\n, Jeremy A Gray ,\nJeremy A Gray , Jeremy A Gray\n, Jeremy A Gray " 34 | } 35 | ], 36 | "cleaned": "fix(parser)!: fix parser bug\n\nFix big parser bug. Fix big parser bug. Fix big parser bug. Fix big\nparser bug. Fix big parser bug. Fix big parser bug. Fix big parser\nbug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix\nbig parser bug.\n\nAlso, format your code with black or black, whichever you prefer.\n\nBREAKING CHANGE: This breaks the old grammar. This breaks the old\ngrammar. This breaks the old grammar. This breaks the old grammar.\nThis breaks the old grammar. This breaks the old grammar. This\nbreaks the old grammar. This breaks the old grammar.\nSigned-Off-By: John Doe , John Doe\n, John Doe , John Doe\n, John Doe , John Doe\n, John Doe \n# This is a comment line that should be ignored.\nSigned-Off-By: Jeremy A Gray , Jeremy A Gray\n, Jeremy A Gray ,\nJeremy A Gray , Jeremy A Gray\n, Jeremy A Gray \n# This is a comment line that should be ignored.\n# This is a comment line that should be ignored. This is a comment line that should be ignored. This is a comment line that should be ignored.\n", 37 | "parseable": true, 38 | "errors": [] 39 | } 40 | -------------------------------------------------------------------------------- /tests/parser/0031.json: -------------------------------------------------------------------------------- 1 | { 2 | "raw": "fix(parser)!: fix parser bug\n\nFix big parser bug. Fix big parser bug. Fix big parser bug. Fix big\nparser bug. Fix big parser bug. Fix big parser bug. Fix big parser\nbug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix\nbig parser bug.\n\nAlso, format your code with black or black, whichever you prefer.\n\nBREAKING CHANGE: This breaks the old grammar.\nsigned-off-by: Jeremy A Gray \nsigned-off-by: John Doe \n", 3 | "parsed": "fix(parser)!: fix parser bug\n\nFix big parser bug. Fix big parser bug. Fix big parser bug. Fix big\nparser bug. Fix big parser bug. Fix big parser bug. Fix big parser\nbug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix\nbig parser bug.\n\nAlso, format your code with black or black, whichever you prefer.\n\nBREAKING CHANGE: This breaks the old grammar.\nSigned-off-by: Jeremy A Gray \nSigned-off-by: John Doe \n", 4 | "header": { 5 | "type": "fix", 6 | "scope": "parser", 7 | "description": "fix parser bug", 8 | "length": 28 9 | }, 10 | "body": { 11 | "paragraphs": [ 12 | "Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix big\nparser bug. Fix big parser bug. Fix big parser bug. Fix big parser\nbug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix\nbig parser bug.\n", 13 | "Also, format your code with black or black, whichever you prefer.\n" 14 | ], 15 | "longest": 68 16 | }, 17 | "breaking": { 18 | "flag": true, 19 | "token": "BREAKING CHANGE", 20 | "separator": ": ", 21 | "value": "This breaks the old grammar.", 22 | "longest": 45 23 | }, 24 | "footers": [ 25 | { 26 | "token": "Signed-off-by", 27 | "separator": ": ", 28 | "value": "Jeremy A Gray " 29 | }, 30 | { 31 | "token": "Signed-off-by", 32 | "separator": ": ", 33 | "value": "John Doe " 34 | } 35 | ], 36 | "cleaned": "fix(parser)!: fix parser bug\n\nFix big parser bug. Fix big parser bug. Fix big parser bug. Fix big\nparser bug. Fix big parser bug. Fix big parser bug. Fix big parser\nbug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix\nbig parser bug.\n\nAlso, format your code with black or black, whichever you prefer.\n\nBREAKING CHANGE: This breaks the old grammar.\nsigned-off-by: Jeremy A Gray \nsigned-off-by: John Doe \n", 37 | "parseable": true, 38 | "errors": [] 39 | } 40 | -------------------------------------------------------------------------------- /tests/parser/0032.json: -------------------------------------------------------------------------------- 1 | { 2 | "raw": "fix(parser)!: fix parser bug\n\nFix big parser bug. Fix big parser bug. Fix big parser bug. Fix big\nparser bug. Fix big parser bug. Fix big parser bug. Fix big parser\nbug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix\nbig parser bug.\n\nAlso, format your code with black or black, whichever you prefer.\n\nBREAKING CHANGE: This breaks the old grammar.\nSIGNED-OFF-BY: Jeremy A Gray \nSIGNED-OFF-BY: John Doe \n", 3 | "parsed": "fix(parser)!: fix parser bug\n\nFix big parser bug. Fix big parser bug. Fix big parser bug. Fix big\nparser bug. Fix big parser bug. Fix big parser bug. Fix big parser\nbug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix\nbig parser bug.\n\nAlso, format your code with black or black, whichever you prefer.\n\nBREAKING CHANGE: This breaks the old grammar.\nSigned-off-by: Jeremy A Gray \nSigned-off-by: John Doe \n", 4 | "header": { 5 | "type": "fix", 6 | "scope": "parser", 7 | "description": "fix parser bug", 8 | "length": 28 9 | }, 10 | "body": { 11 | "paragraphs": [ 12 | "Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix big\nparser bug. Fix big parser bug. Fix big parser bug. Fix big parser\nbug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix\nbig parser bug.\n", 13 | "Also, format your code with black or black, whichever you prefer.\n" 14 | ], 15 | "longest": 68 16 | }, 17 | "breaking": { 18 | "flag": true, 19 | "token": "BREAKING CHANGE", 20 | "separator": ": ", 21 | "value": "This breaks the old grammar.", 22 | "longest": 45 23 | }, 24 | "footers": [ 25 | { 26 | "token": "Signed-off-by", 27 | "separator": ": ", 28 | "value": "Jeremy A Gray " 29 | }, 30 | { 31 | "token": "Signed-off-by", 32 | "separator": ": ", 33 | "value": "John Doe " 34 | } 35 | ], 36 | "cleaned": "fix(parser)!: fix parser bug\n\nFix big parser bug. Fix big parser bug. Fix big parser bug. Fix big\nparser bug. Fix big parser bug. Fix big parser bug. Fix big parser\nbug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix\nbig parser bug.\n\nAlso, format your code with black or black, whichever you prefer.\n\nBREAKING CHANGE: This breaks the old grammar.\nSIGNED-OFF-BY: Jeremy A Gray \nSIGNED-OFF-BY: John Doe \n", 37 | "parseable": true, 38 | "errors": [] 39 | } 40 | -------------------------------------------------------------------------------- /tests/parser/0033.json: -------------------------------------------------------------------------------- 1 | { 2 | "raw": "fix(parser)!: fix parser bug\n\nFix big parser bug. Fix big parser bug. Fix big parser bug. Fix big\nparser bug. Fix big parser bug. Fix big parser bug. Fix big parser\nbug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix\nbig parser bug.\n\nAlso, format your code with black or black, whichever you prefer.\n\nBREAKING CHANGE: This breaks the old grammar.\nSIGNED-off-by: Jeremy A Gray \nsigned-OFF-By: John Doe \n", 3 | "parsed": "fix(parser)!: fix parser bug\n\nFix big parser bug. Fix big parser bug. Fix big parser bug. Fix big\nparser bug. Fix big parser bug. Fix big parser bug. Fix big parser\nbug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix\nbig parser bug.\n\nAlso, format your code with black or black, whichever you prefer.\n\nBREAKING CHANGE: This breaks the old grammar.\nSigned-off-by: Jeremy A Gray \nSigned-off-by: John Doe \n", 4 | "header": { 5 | "type": "fix", 6 | "scope": "parser", 7 | "description": "fix parser bug", 8 | "length": 28 9 | }, 10 | "body": { 11 | "paragraphs": [ 12 | "Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix big\nparser bug. Fix big parser bug. Fix big parser bug. Fix big parser\nbug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix\nbig parser bug.\n", 13 | "Also, format your code with black or black, whichever you prefer.\n" 14 | ], 15 | "longest": 68 16 | }, 17 | "breaking": { 18 | "flag": true, 19 | "token": "BREAKING CHANGE", 20 | "separator": ": ", 21 | "value": "This breaks the old grammar.", 22 | "longest": 45 23 | }, 24 | "footers": [ 25 | { 26 | "token": "Signed-off-by", 27 | "separator": ": ", 28 | "value": "Jeremy A Gray " 29 | }, 30 | { 31 | "token": "Signed-off-by", 32 | "separator": ": ", 33 | "value": "John Doe " 34 | } 35 | ], 36 | "cleaned": "fix(parser)!: fix parser bug\n\nFix big parser bug. Fix big parser bug. Fix big parser bug. Fix big\nparser bug. Fix big parser bug. Fix big parser bug. Fix big parser\nbug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix\nbig parser bug.\n\nAlso, format your code with black or black, whichever you prefer.\n\nBREAKING CHANGE: This breaks the old grammar.\nSIGNED-off-by: Jeremy A Gray \nsigned-OFF-By: John Doe \n", 37 | "parseable": true, 38 | "errors": [] 39 | } 40 | -------------------------------------------------------------------------------- /tests/parser/0034.json: -------------------------------------------------------------------------------- 1 | { 2 | "raw": "fix: find parser bug by checking for overly long headers\n\nBREAKING CHANGE: This breaks the old grammar.\n", 3 | "cleaned": "fix: find parser bug by checking for overly long headers\n\nBREAKING CHANGE: This breaks the old grammar.\n", 4 | "parsed": "fix: find parser bug by checking for overly long headers\n\nBREAKING CHANGE: This breaks the old grammar.\n", 5 | "header": { 6 | "type": "fix", 7 | "scope": "", 8 | "description": "find parser bug by checking for overly long headers", 9 | "length": 56 10 | }, 11 | "body": { 12 | "paragraphs": [], 13 | "longest": 0 14 | }, 15 | "breaking": { 16 | "flag": false, 17 | "token": "BREAKING CHANGE", 18 | "separator": ": ", 19 | "value": "This breaks the old grammar.", 20 | "longest": 45 21 | }, 22 | "footers": [], 23 | "parseable": true, 24 | "errors": [ 25 | "header_length" 26 | ] 27 | } 28 | -------------------------------------------------------------------------------- /tests/parser/0035.json: -------------------------------------------------------------------------------- 1 | { 2 | "raw": "redo: fix parser bug\n", 3 | "cleaned": "redo: fix parser bug\n", 4 | "parsed": "redo: fix parser bug\n", 5 | "header": { 6 | "type": "redo", 7 | "scope": "", 8 | "description": "fix parser bug", 9 | "length": 20 10 | }, 11 | "body": { 12 | "paragraphs": [], 13 | "longest": 0 14 | }, 15 | "breaking": { 16 | "flag": false, 17 | "token": "", 18 | "separator": ": ", 19 | "value": "", 20 | "longest": 0 21 | }, 22 | "footers": [], 23 | "parseable": false, 24 | "errors": [] 25 | } 26 | -------------------------------------------------------------------------------- /tests/parser/0036.json: -------------------------------------------------------------------------------- 1 | { 2 | "raw": "redo(parser): fix parser bug\n", 3 | "cleaned": "redo(parser): fix parser bug\n", 4 | "parsed": "redo(parser): fix parser bug\n", 5 | "header": { 6 | "type": "redo", 7 | "scope": "parser", 8 | "description": "fix parser bug", 9 | "length": 28 10 | }, 11 | "body": { 12 | "paragraphs": [], 13 | "longest": 0 14 | }, 15 | "breaking": { 16 | "flag": false, 17 | "token": "", 18 | "separator": ": ", 19 | "value": "", 20 | "longest": 0 21 | }, 22 | "footers": [], 23 | "parseable": false, 24 | "errors": [] 25 | } 26 | -------------------------------------------------------------------------------- /tests/parser/0037.json: -------------------------------------------------------------------------------- 1 | { 2 | "raw": "redo(docs): fix parser bug\n", 3 | "cleaned": "redo(docs): fix parser bug\n", 4 | "parsed": "redo(docs): fix parser bug\n", 5 | "header": { 6 | "type": "redo", 7 | "scope": "docs", 8 | "description": "fix parser bug", 9 | "length": 26 10 | }, 11 | "body": { 12 | "paragraphs": [], 13 | "longest": 0 14 | }, 15 | "breaking": { 16 | "flag": false, 17 | "token": "", 18 | "separator": ": ", 19 | "value": "", 20 | "longest": 0 21 | }, 22 | "footers": [], 23 | "parseable": false, 24 | "errors": [] 25 | } 26 | -------------------------------------------------------------------------------- /tests/parser/0038.json: -------------------------------------------------------------------------------- 1 | { 2 | "raw": "fix(docs): fix parser bug\n", 3 | "cleaned": "fix(docs): fix parser bug\n", 4 | "parsed": "fix(docs): fix parser bug\n", 5 | "header": { 6 | "type": "fix", 7 | "scope": "docs", 8 | "description": "fix parser bug", 9 | "length": 25 10 | }, 11 | "body": { 12 | "paragraphs": [], 13 | "longest": 0 14 | }, 15 | "breaking": { 16 | "flag": false, 17 | "token": "", 18 | "separator": "", 19 | "value": "", 20 | "longest": 0 21 | }, 22 | "footers": [], 23 | "parseable": true, 24 | "errors": [] 25 | } 26 | -------------------------------------------------------------------------------- /tests/parser/0039.json: -------------------------------------------------------------------------------- 1 | { 2 | "raw": "fix?: fix parser bug\n", 3 | "cleaned": "fix?: fix parser bug\n", 4 | "parsed": "fix?: fix parser bug\n", 5 | "header": { 6 | "type": "fix", 7 | "scope": "", 8 | "description": "fix parser bug", 9 | "length": 20 10 | }, 11 | "body": { 12 | "paragraphs": [], 13 | "longest": 0 14 | }, 15 | "breaking": { 16 | "flag": false, 17 | "token": "", 18 | "separator": ": ", 19 | "value": "", 20 | "longest": 0 21 | }, 22 | "footers": [], 23 | "parseable": false, 24 | "errors": [] 25 | } 26 | -------------------------------------------------------------------------------- /tests/parser/0040.json: -------------------------------------------------------------------------------- 1 | { 2 | "raw": "redo!: fix parser bug\n", 3 | "cleaned": "redo!: fix parser bug\n", 4 | "parsed": "redo!: fix parser bug\n", 5 | "header": { 6 | "type": "redo", 7 | "scope": "", 8 | "description": "fix parser bug", 9 | "length": 21 10 | }, 11 | "body": { 12 | "paragraphs": [], 13 | "longest": 0 14 | }, 15 | "breaking": { 16 | "flag": true, 17 | "token": "", 18 | "separator": ": ", 19 | "value": "", 20 | "longest": 0 21 | }, 22 | "footers": [], 23 | "parseable": false, 24 | "errors": [] 25 | } 26 | -------------------------------------------------------------------------------- /tests/parser/0041.json: -------------------------------------------------------------------------------- 1 | { 2 | "raw": "fix!(parser): fix parser bug\n", 3 | "cleaned": "fix!(parser): fix parser bug\n", 4 | "parsed": "fix!(parser): fix parser bug\n", 5 | "header": { 6 | "type": "fix", 7 | "scope": "parser", 8 | "description": "fix parser bug", 9 | "length": 28 10 | }, 11 | "body": { 12 | "paragraphs": [], 13 | "longest": 0 14 | }, 15 | "breaking": { 16 | "flag": true, 17 | "token": "", 18 | "separator": ": ", 19 | "value": "", 20 | "longest": 0 21 | }, 22 | "footers": [], 23 | "parseable": false, 24 | "errors": [] 25 | } 26 | -------------------------------------------------------------------------------- /tests/parser/0042.json: -------------------------------------------------------------------------------- 1 | { 2 | "raw": "fix?(parser): fix parser bug\n", 3 | "cleaned": "fix?(parser): fix parser bug\n", 4 | "parsed": "fix?(parser): fix parser bug\n", 5 | "header": { 6 | "type": "fix", 7 | "scope": "parser", 8 | "description": "fix parser bug", 9 | "length": 28 10 | }, 11 | "body": { 12 | "paragraphs": [], 13 | "longest": 0 14 | }, 15 | "breaking": { 16 | "flag": false, 17 | "token": "", 18 | "separator": ": ", 19 | "value": "", 20 | "longest": 0 21 | }, 22 | "footers": [], 23 | "parseable": false, 24 | "errors": [] 25 | } 26 | -------------------------------------------------------------------------------- /tests/parser/0043.json: -------------------------------------------------------------------------------- 1 | { 2 | "raw": "fix(parser)!: fix parser bug\n\nFix big parser bug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix big parser\nbug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix\nbig parser bug.\n\nAlso, format your code with black or black, whichever you prefer.\n\nBREAKING CHANGE: This breaks the old grammar.\nSIGNED-off-by: Jeremy A Gray \nsigned-OFF-By: John Doe \n", 3 | "parsed": "fix(parser)!: fix parser bug\n\nFix big parser bug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix big parser\nbug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix\nbig parser bug.\n\nAlso, format your code with black or black, whichever you prefer.\n\nBREAKING CHANGE: This breaks the old grammar.\nSigned-off-by: Jeremy A Gray \nSigned-off-by: John Doe \n", 4 | "header": { 5 | "type": "fix", 6 | "scope": "parser", 7 | "description": "fix parser bug", 8 | "length": 28 9 | }, 10 | "body": { 11 | "paragraphs": [ 12 | "Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix big parser\nbug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix\nbig parser bug.\n", 13 | "Also, format your code with black or black, whichever you prefer.\n" 14 | ], 15 | "longest": 134 16 | }, 17 | "breaking": { 18 | "flag": true, 19 | "token": "BREAKING CHANGE", 20 | "separator": ": ", 21 | "value": "This breaks the old grammar.", 22 | "longest": 45 23 | }, 24 | "footers": [ 25 | { 26 | "token": "Signed-off-by", 27 | "separator": ": ", 28 | "value": "Jeremy A Gray " 29 | }, 30 | { 31 | "token": "Signed-off-by", 32 | "separator": ": ", 33 | "value": "John Doe " 34 | } 35 | ], 36 | "cleaned": "fix(parser)!: fix parser bug\n\nFix big parser bug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix big parser\nbug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix\nbig parser bug.\n\nAlso, format your code with black or black, whichever you prefer.\n\nBREAKING CHANGE: This breaks the old grammar.\nSIGNED-off-by: Jeremy A Gray \nsigned-OFF-By: John Doe \n", 37 | "parseable": true, 38 | "errors": [ 39 | "body_length" 40 | ] 41 | } 42 | -------------------------------------------------------------------------------- /tests/parser/0044.json: -------------------------------------------------------------------------------- 1 | { 2 | "raw": "fix(parser)!: fix parser bug\n\nFix big parser bug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix big parser bug.\n\nAlso, format your code with black or black, whichever you prefer.\n\nBREAKING CHANGE: This breaks the old grammar. This breaks the old grammar. This breaks the old grammar. This breaks the old grammar. This breaks the old grammar. This breaks the old grammar. This breaks the old grammar. This breaks the old grammar.\nSigned-Off-By: John Doe , John Doe\n, John Doe , John Doe\n, John Doe , John Doe\n, John Doe \n# This is a comment line that should be ignored.\nSigned-Off-By: Jeremy A Gray , Jeremy A Gray\n, Jeremy A Gray ,\nJeremy A Gray , Jeremy A Gray\n, Jeremy A Gray \n# This is a comment line that should be ignored.\n# This is a comment line that should be ignored. This is a comment line that should be ignored. This is a comment line that should be ignored.\n", 3 | "parsed": "fix(parser)!: fix parser bug\n\nFix big parser bug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix big parser bug.\n\nAlso, format your code with black or black, whichever you prefer.\n\nBREAKING CHANGE: This breaks the old grammar. This breaks the old grammar. This breaks the old grammar. This breaks the old grammar. This breaks the old grammar. This breaks the old grammar. This breaks the old grammar. This breaks the old grammar.\nSigned-off-by: John Doe , John Doe\n, John Doe , John Doe\n, John Doe , John Doe\n, John Doe \nSigned-off-by: Jeremy A Gray , Jeremy A Gray\n, Jeremy A Gray ,\nJeremy A Gray , Jeremy A Gray\n, Jeremy A Gray \n", 4 | "header": { 5 | "type": "fix", 6 | "scope": "parser", 7 | "description": "fix parser bug", 8 | "length": 28 9 | }, 10 | "body": { 11 | "paragraphs": [ 12 | "Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix big parser bug.\n", 13 | "Also, format your code with black or black, whichever you prefer.\n" 14 | ], 15 | "longest": 219 16 | }, 17 | "70": { 18 | "body": { 19 | "paragraphs": [ 20 | "Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix big\nparser bug. Fix big parser bug. Fix big parser bug. Fix big parser\nbug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix\nbig parser bug.\n", 21 | "Also, format your code with black or black, whichever you prefer.\n" 22 | ], 23 | "longest": 68 24 | }, 25 | "breaking": { 26 | "flag": true, 27 | "token": "BREAKING CHANGE", 28 | "separator": ": ", 29 | "value": "This breaks the old grammar. This breaks the old\ngrammar. This breaks the old grammar. This breaks the old grammar.\nThis breaks the old grammar. This breaks the old grammar. This\nbreaks the old grammar. This breaks the old grammar.", 30 | "longest": 68 31 | } 32 | }, 33 | "72": { 34 | "body": { 35 | "paragraphs": [ 36 | "Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix big\nparser bug. Fix big parser bug. Fix big parser bug. Fix big parser bug.\nFix big parser bug. Fix big parser bug. Fix big parser bug. Fix big\nparser bug.\n", 37 | "Also, format your code with black or black, whichever you prefer.\n" 38 | ], 39 | "longest": 71 40 | }, 41 | "breaking": { 42 | "flag": true, 43 | "token": "BREAKING CHANGE", 44 | "separator": ": ", 45 | "value": "This breaks the old grammar. This breaks the old\ngrammar. This breaks the old grammar. This breaks the old grammar.\nThis breaks the old grammar. This breaks the old grammar. This breaks\nthe old grammar. This breaks the old grammar.", 46 | "longest": 71 47 | } 48 | }, 49 | "breaking": { 50 | "flag": true, 51 | "token": "BREAKING CHANGE", 52 | "separator": ": ", 53 | "value": "This breaks the old grammar. This breaks the old\ngrammar. This breaks the old grammar. This breaks the old grammar.\nThis breaks the old grammar. This breaks the old grammar. This\nbreaks the old grammar. This breaks the old grammar.", 54 | "longest": 72 55 | }, 56 | "footers": [ 57 | { 58 | "token": "Signed-off-by", 59 | "separator": ": ", 60 | "value": "John Doe , John Doe\n, John Doe , John Doe\n, John Doe , John Doe\n, John Doe " 61 | }, 62 | { 63 | "token": "Signed-off-by", 64 | "separator": ": ", 65 | "value": "Jeremy A Gray , Jeremy A Gray\n, Jeremy A Gray ,\nJeremy A Gray , Jeremy A Gray\n, Jeremy A Gray " 66 | } 67 | ], 68 | "cleaned": "fix(parser)!: fix parser bug\n\nFix big parser bug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix big parser bug. Fix big parser bug.\n\nAlso, format your code with black or black, whichever you prefer.\n\nBREAKING CHANGE: This breaks the old grammar. This breaks the old\ngrammar. This breaks the old grammar. This breaks the old grammar.\nThis breaks the old grammar. This breaks the old grammar. This\nbreaks the old grammar. This breaks the old grammar.\nSigned-Off-By: John Doe , John Doe\n, John Doe , John Doe\n, John Doe , John Doe\n, John Doe \nSigned-Off-By: Jeremy A Gray , Jeremy A Gray\n, Jeremy A Gray ,\nJeremy A Gray , Jeremy A Gray\n, Jeremy A Gray \n", 69 | "parseable": true, 70 | "errors": [] 71 | } 72 | -------------------------------------------------------------------------------- /tests/parser/0045.json: -------------------------------------------------------------------------------- 1 | { 2 | "raw": "(tag: v0.10.0) 0.10.0\n", 3 | "parseable": false, 4 | "generated": true 5 | } 6 | -------------------------------------------------------------------------------- /tests/parser/0046.json: -------------------------------------------------------------------------------- 1 | { 2 | "raw": "Merge branch 'master' of github.com:username/project\n", 3 | "parseable": false, 4 | "generated": true 5 | } 6 | -------------------------------------------------------------------------------- /tests/parser/0048.json: -------------------------------------------------------------------------------- 1 | { 2 | "raw": "feat(parser): add closing footer\n\nAdd closing footer to allow github issue closing.\n\nGithub-closes: closes jeremyagray/pccc#1\n", 3 | "parsed": "feat(parser): add closing footer\n\nAdd closing footer to allow github issue closing.\n\nGithub-closes: closes jeremyagray/pccc#1\n", 4 | "header": { 5 | "type": "feat", 6 | "scope": "parser", 7 | "description": "add closing footer", 8 | "length": 32 9 | }, 10 | "body": { 11 | "paragraphs": ["Add closing footer to allow github issue closing.\n"], 12 | "longest": 49 13 | }, 14 | "breaking": { 15 | "flag": false, 16 | "token": "", 17 | "separator": "", 18 | "value": "", 19 | "longest": 0 20 | }, 21 | "footers": [ 22 | { 23 | "token": "Github-closes", 24 | "separator": ": ", 25 | "value": "closes jeremyagray/pccc#1" 26 | } 27 | ], 28 | "closes_issues": [ 29 | { 30 | "keyword": "closes", 31 | "owner": "jeremyagray", 32 | "repo": "pccc", 33 | "number": "1" 34 | } 35 | ], 36 | "cleaned": "feat(parser): add closing footer\n\nAdd closing footer to allow github issue closing.\n\nGithub-closes: closes jeremyagray/pccc#1\n", 37 | "parseable": true, 38 | "errors": [] 39 | } 40 | -------------------------------------------------------------------------------- /tests/parser/0049.json: -------------------------------------------------------------------------------- 1 | { 2 | "raw": "feat(parser): add closing footer\n\nAdd closing footer to allow github issue closing.\n\nGithub-closes: closes jeremyagray/pccc#1\nBREAKING-CHANGE: This change breaks.\n", 3 | "parsed": "feat(parser): add closing footer\n\nAdd closing footer to allow github issue closing.\n\nBREAKING-CHANGE: This change breaks.\nGithub-closes: closes jeremyagray/pccc#1\n", 4 | "header": { 5 | "type": "feat", 6 | "scope": "parser", 7 | "description": "add closing footer", 8 | "length": 32 9 | }, 10 | "body": { 11 | "paragraphs": ["Add closing footer to allow github issue closing.\n"], 12 | "longest": 49 13 | }, 14 | "breaking": { 15 | "flag": false, 16 | "token": "BREAKING-CHANGE", 17 | "separator": ": ", 18 | "value": "This change breaks.", 19 | "longest": 36 20 | }, 21 | "footers": [ 22 | { 23 | "token": "Github-closes", 24 | "separator": ": ", 25 | "value": "closes jeremyagray/pccc#1" 26 | } 27 | ], 28 | "closes_issues": [ 29 | { 30 | "keyword": "closes", 31 | "owner": "jeremyagray", 32 | "repo": "pccc", 33 | "number": "1" 34 | } 35 | ], 36 | "cleaned": "feat(parser): add closing footer\n\nAdd closing footer to allow github issue closing.\n\nGithub-closes: closes jeremyagray/pccc#1\nBREAKING-CHANGE: This change breaks.\n", 37 | "parseable": true, 38 | "errors": [] 39 | } 40 | -------------------------------------------------------------------------------- /tests/parser/0050.json: -------------------------------------------------------------------------------- 1 | { 2 | "raw": "feat(parser): add closing footer\n\nAdd closing footer to allow github issue closing.\n\nBREAKING-CHANGE: This change breaks.\nGithub-closes: closes jeremyagray/pccc#1\n", 3 | "parsed": "feat(parser): add closing footer\n\nAdd closing footer to allow github issue closing.\n\nBREAKING-CHANGE: This change breaks.\nGithub-closes: closes jeremyagray/pccc#1\n", 4 | "header": { 5 | "type": "feat", 6 | "scope": "parser", 7 | "description": "add closing footer", 8 | "length": 32 9 | }, 10 | "body": { 11 | "paragraphs": ["Add closing footer to allow github issue closing.\n"], 12 | "longest": 49 13 | }, 14 | "breaking": { 15 | "flag": false, 16 | "token": "BREAKING-CHANGE", 17 | "separator": ": ", 18 | "value": "This change breaks.", 19 | "longest": 36 20 | }, 21 | "footers": [ 22 | { 23 | "token": "Github-closes", 24 | "separator": ": ", 25 | "value": "closes jeremyagray/pccc#1" 26 | } 27 | ], 28 | "closes_issues": [ 29 | { 30 | "keyword": "closes", 31 | "owner": "jeremyagray", 32 | "repo": "pccc", 33 | "number": "1" 34 | } 35 | ], 36 | "cleaned": "feat(parser): add closing footer\n\nAdd closing footer to allow github issue closing.\n\nBREAKING-CHANGE: This change breaks.\nGithub-closes: closes jeremyagray/pccc#1\n", 37 | "parseable": true, 38 | "errors": [] 39 | } 40 | -------------------------------------------------------------------------------- /tests/parser/0051.json: -------------------------------------------------------------------------------- 1 | { 2 | "raw": "feat(parser): add closing footer\n\nAdd closing footer to allow github issue closing.\n\nBREAKING-CHANGE: This change breaks.\nGithub-closes: closes jeremyagray/pccc#1, closes jeremyagray/fqs#17\n", 3 | "parsed": "feat(parser): add closing footer\n\nAdd closing footer to allow github issue closing.\n\nBREAKING-CHANGE: This change breaks.\nGithub-closes: closes jeremyagray/pccc#1, closes jeremyagray/fqs#17\n", 4 | "header": { 5 | "type": "feat", 6 | "scope": "parser", 7 | "description": "add closing footer", 8 | "length": 32 9 | }, 10 | "body": { 11 | "paragraphs": ["Add closing footer to allow github issue closing.\n"], 12 | "longest": 49 13 | }, 14 | "breaking": { 15 | "flag": false, 16 | "token": "BREAKING-CHANGE", 17 | "separator": ": ", 18 | "value": "This change breaks.", 19 | "longest": 36 20 | }, 21 | "footers": [ 22 | { 23 | "token": "Github-closes", 24 | "separator": ": ", 25 | "value": "closes jeremyagray/pccc#1, closes jeremyagray/fqs#17" 26 | } 27 | ], 28 | "closes_issues": [ 29 | { 30 | "keyword": "closes", 31 | "owner": "jeremyagray", 32 | "repo": "pccc", 33 | "number": "1" 34 | }, 35 | { 36 | "keyword": "closes", 37 | "owner": "jeremyagray", 38 | "repo": "fqs", 39 | "number": "17" 40 | } 41 | ], 42 | "cleaned": "feat(parser): add closing footer\n\nAdd closing footer to allow github issue closing.\n\nBREAKING-CHANGE: This change breaks.\nGithub-closes: closes jeremyagray/pccc#1, closes jeremyagray/fqs#17\n", 43 | "parseable": true, 44 | "errors": [] 45 | } 46 | -------------------------------------------------------------------------------- /tests/parser/0052.json: -------------------------------------------------------------------------------- 1 | { 2 | "raw": "feat(parser): add closing footer\n\nAdd closing footer to allow github issue closing.\n\nBREAKING-CHANGE: This change breaks.\nGithub-closes: closes jeremyagray/pccc#1, closes jeremyagray/fqs-#17\n", 3 | "parsed": "feat(parser): add closing footer\n\nAdd closing footer to allow github issue closing.\n\nBREAKING-CHANGE: This change breaks.\nGithub-closes: closes jeremyagray/pccc#1, closes jeremyagray/fqs#17\n", 4 | "header": { 5 | "type": "feat", 6 | "scope": "parser", 7 | "description": "add closing footer", 8 | "length": 32 9 | }, 10 | "body": { 11 | "paragraphs": ["Add closing footer to allow github issue closing.\n"], 12 | "longest": 49 13 | }, 14 | "breaking": { 15 | "flag": false, 16 | "token": "BREAKING-CHANGE", 17 | "separator": ": ", 18 | "value": "This change breaks.", 19 | "longest": 36 20 | }, 21 | "footers": [ 22 | { 23 | "token": "Github-closes", 24 | "separator": ": ", 25 | "value": "closes jeremyagray/pccc#1, closes jeremyagray/fqs#17" 26 | } 27 | ], 28 | "closes_issues": [ 29 | { 30 | "keyword": "closes", 31 | "owner": "jeremyagray", 32 | "repo": "pccc", 33 | "number": "1" 34 | }, 35 | { 36 | "keyword": "closes", 37 | "owner": "jeremyagray", 38 | "repo": "fqs", 39 | "number": "17" 40 | } 41 | ], 42 | "cleaned": "feat(parser): add closing footer\n\nAdd closing footer to allow github issue closing.\n\nBREAKING-CHANGE: This change breaks.\nGithub-closes: closes jeremyagray/pccc#1, closes jeremyagray/fqs#17\n", 43 | "parseable": false, 44 | "errors": [] 45 | } 46 | -------------------------------------------------------------------------------- /tests/parser/0053.json: -------------------------------------------------------------------------------- 1 | { 2 | "raw": "feat(parser): add closing footer\n\nAdd closing foter to allow github issue closing.\n", 3 | "cleaned": "feat(parser): add closing footer\n\nAdd closing foter to allow github issue closing.\n", 4 | "parsed": "feat(parser): add closing footer\n\nAdd closing foter to allow github issue closing.\n", 5 | "parseable": true, 6 | "header": { 7 | "type": "feat", 8 | "scope": "parser", 9 | "description": "add closing footer", 10 | "length": 32 11 | }, 12 | "body": { 13 | "paragraphs": ["Add closing foter to allow github issue closing.\n"], 14 | "longest": 48 15 | }, 16 | "breaking": { 17 | "flag": false, 18 | "token": "", 19 | "separator": "", 20 | "value": "", 21 | "longest": 0 22 | }, 23 | "footers": [], 24 | "errors": [] 25 | } 26 | -------------------------------------------------------------------------------- /tests/parser/0054.json: -------------------------------------------------------------------------------- 1 | { 2 | "raw": "feat(parser): add closing footer\n\nAdd closing footer to allow github issue closing.\n\nGithub-closes: closes jeremyagray/pccc/#1\n", 3 | "parsed": "feat(parser): add closing footer\n\nAdd closing footer to allow github issue closing.\n\nGithub-closes: closes jeremyagray/pccc/#1\n", 4 | "header": { 5 | "type": "feat", 6 | "scope": "parser", 7 | "description": "add closing footer", 8 | "length": 32 9 | }, 10 | "body": { 11 | "paragraphs": ["Add closing footer to allow github issue closing.\n"], 12 | "longest": 49 13 | }, 14 | "breaking": { 15 | "flag": false, 16 | "token": "", 17 | "separator": "", 18 | "value": "", 19 | "longest": 0 20 | }, 21 | "footers": [ 22 | { 23 | "token": "Github-closes", 24 | "separator": ": ", 25 | "value": "closes jeremyagray/pccc#1" 26 | } 27 | ], 28 | "closes_issues": [ 29 | { 30 | "keyword": "closes", 31 | "owner": "jeremyagray", 32 | "repo": "pccc", 33 | "number": "#1" 34 | } 35 | ], 36 | "cleaned": "feat(parser): add closing footer\n\nAdd closing footer to allow github issue closing.\n\nGithub-closes: closes jeremyagray/pccc#1\n", 37 | "parseable": false, 38 | "errors": [] 39 | } 40 | -------------------------------------------------------------------------------- /tests/parser/template.json: -------------------------------------------------------------------------------- 1 | { 2 | "parseable": true, 3 | "errors": [], 4 | "raw": "", 5 | "cleaned": "", 6 | "parsed": "", 7 | "header": { 8 | "type": "", 9 | "scope": "", 10 | "description": "", 11 | "length": 0 12 | }, 13 | "body": { 14 | "paragraphs": [ 15 | ], 16 | "longest": 0 17 | }, 18 | "breaking": { 19 | "flag": false, 20 | "token": "", 21 | "separator": "", 22 | "value": "" 23 | }, 24 | "footers": [ 25 | { 26 | "token": "", 27 | "separator": "", 28 | "value": "" 29 | } 30 | ] 31 | } 32 | -------------------------------------------------------------------------------- /tests/test_config.py: -------------------------------------------------------------------------------- 1 | # ****************************************************************************** 2 | # 3 | # pccc, the Python Conventional Commit Checker. 4 | # 5 | # SPDX-License-Identifier: GPL-3.0-or-later 6 | # 7 | # Copyright 2020-2023 Jeremy A Gray . 8 | # 9 | # ****************************************************************************** 10 | 11 | """Config unit tests.""" 12 | 13 | import json 14 | import os 15 | import re 16 | import sys 17 | 18 | import bespon 19 | import pytest 20 | import toml 21 | from hypothesis import given 22 | from hypothesis import strategies as st 23 | from ruamel.yaml import YAML 24 | 25 | sys.path.insert(0, "/home/gray/src/work/pccc") 26 | 27 | import pccc # noqa: E402 28 | 29 | 30 | def load_configuration_data(): 31 | """Load configuration data for testing.""" 32 | data = [] 33 | json_file_re = re.compile(r"\d{4}\.json$") 34 | 35 | with os.scandir("./tests/config") as dir: 36 | for entry in dir: 37 | if entry.is_file() and json_file_re.match(entry.name): 38 | with open(entry.path, "r") as file: 39 | try: 40 | datum = json.load(file) 41 | except json.JSONDecodeError as error: 42 | print(f"JSON error in file {entry.name}") 43 | raise error 44 | data.append(tuple([entry.path, datum])) 45 | 46 | return tuple(data) 47 | 48 | 49 | def tomlify_list(list): 50 | """Stringify a list as ``toml.dumps()`` would.""" 51 | if list: 52 | return '[ "' + '", "'.join(list) + '",]' 53 | else: 54 | return "[]" 55 | 56 | 57 | @st.composite 58 | def configuration(draw): 59 | """Generate a configuration object strategy.""" 60 | footers = draw( 61 | st.lists( 62 | st.text( 63 | st.characters( 64 | whitelist_categories=("L", "N"), 65 | blacklist_categories=("C"), 66 | ), 67 | min_size=3, 68 | max_size=10, 69 | ), 70 | unique=True, 71 | ) 72 | ) 73 | 74 | return pccc.Config( 75 | header_length=draw(st.integers(min_value=50, max_value=50)), 76 | body_length=draw(st.integers(min_value=70, max_value=120)), 77 | repair=draw(st.booleans()), 78 | wrap=draw(st.booleans()), 79 | force_wrap=draw(st.booleans()), 80 | spell_check=draw(st.booleans()), 81 | ignore_generated_commits=draw(st.booleans()), 82 | generated_commits=draw( 83 | st.lists( 84 | st.text( 85 | st.characters( 86 | whitelist_categories=("L", "N", "P"), 87 | blacklist_categories=("C"), 88 | ), 89 | min_size=3, 90 | max_size=10, 91 | ), 92 | unique=True, 93 | ) 94 | ), 95 | types=draw( 96 | st.lists( 97 | st.text( 98 | st.characters( 99 | whitelist_categories=("L", "N"), 100 | blacklist_categories=("C"), 101 | ), 102 | min_size=3, 103 | max_size=10, 104 | ), 105 | unique=True, 106 | ) 107 | ), 108 | scopes=draw( 109 | st.lists( 110 | st.text( 111 | st.characters( 112 | whitelist_categories=("L", "N"), 113 | blacklist_categories=("C"), 114 | ), 115 | min_size=3, 116 | max_size=10, 117 | ), 118 | unique=True, 119 | ) 120 | ), 121 | footers=footers, 122 | required_footers=footers, 123 | ) 124 | 125 | 126 | @given(conf=configuration()) 127 | def test_stringify_config(conf): 128 | """Should stringify a config.""" 129 | ccr = pccc.ConventionalCommitRunner() 130 | ccr.options = conf 131 | 132 | # Assert the TOML is correct. 133 | assert f"header_length = {conf.header_length}" in str(ccr.options) 134 | assert f"body_length = {conf.body_length}" in str(ccr.options) 135 | assert f"repair = {str(conf.repair).lower()}" in str(ccr.options) 136 | assert f"wrap = {str(conf.wrap).lower()}" in str(ccr.options) 137 | assert f"force_wrap = {str(conf.force_wrap).lower()}" in str(ccr.options) 138 | assert f"spell_check = {str(conf.spell_check).lower()}" in str(ccr.options) 139 | assert ( 140 | f"ignore_generated_commits = {str(conf.ignore_generated_commits).lower()}" 141 | in str(ccr.options) 142 | ) 143 | assert f"types = {tomlify_list(conf.types)}" in str(ccr.options) 144 | 145 | # Assert the JSON is correct. 146 | ccr.options.set_format("JSON") 147 | assert f'"header_length": {conf.header_length}' in str(ccr.options) 148 | assert f'"body_length": {conf.body_length}' in str(ccr.options) 149 | assert f'"repair": {str(conf.repair).lower()}' in str(ccr.options) 150 | assert f'"wrap": {str(conf.wrap).lower()}' in str(ccr.options) 151 | assert f'"force_wrap": {str(conf.force_wrap).lower()}' in str(ccr.options) 152 | assert f'"spell_check": {str(conf.spell_check).lower()}' in str(ccr.options) 153 | assert ( 154 | f'"ignore_generated_commits": {str(conf.ignore_generated_commits).lower()}' 155 | in str(ccr.options) 156 | ) 157 | 158 | 159 | @given(conf=configuration()) 160 | def test_reproduce_config(conf): 161 | """Should reproduce a config.""" 162 | ccr = pccc.ConventionalCommitRunner() 163 | ccr.options = conf 164 | 165 | # Assert on the repr(). 166 | assert f"header_length={conf.header_length}" in repr(ccr.options) 167 | assert f"body_length={conf.body_length}" in repr(ccr.options) 168 | assert f"repair={conf.repair}" in repr(ccr.options) 169 | assert f"wrap={conf.wrap}" in repr(ccr.options) 170 | assert f"force_wrap={conf.force_wrap}" in repr(ccr.options) 171 | assert f"spell_check={conf.spell_check}" in repr(ccr.options) 172 | assert f"ignore_generated_commits={conf.ignore_generated_commits}" in repr( 173 | ccr.options 174 | ) 175 | assert f"types={conf.types}" in repr(ccr.options) 176 | assert f"scopes={conf.scopes}" in repr(ccr.options) 177 | 178 | 179 | # FIXME 180 | @pytest.mark.parametrize( 181 | "fn, data", 182 | load_configuration_data(), 183 | ) 184 | def test_str_repr_property(fn, data, fs): 185 | """Should not change depending on source format. 186 | 187 | Test ``Config().__str__()`` and ``Config().__repr__()`` by writing 188 | and loading the fixture data created to each other using TOML, 189 | JSON, TOML then JSON, and JSON then TOML and then comparing both 190 | the strings written and the objects. 191 | """ 192 | # Use the fixture's JSON to write a TOML file, then load the TOML 193 | # and write a second file. Then, assert that the two ``Config()`` 194 | # objects have equal reproductions and string representations. 195 | fn = "one.toml" 196 | fs.create_file(fn) 197 | with open(fn, "w") as f: 198 | tdata = {"pccc": data["pccc"]} 199 | toml.dump(tdata, f) 200 | 201 | ccr_one = pccc.ConventionalCommitRunner() 202 | ccr_one.options.load(["--config", fn] + data["cli"]) 203 | fs.remove_object(fn) 204 | 205 | fn = "two.toml" 206 | fs.create_file(fn) 207 | with open(fn, "w") as f: 208 | f.write(str(ccr_one.options)) 209 | 210 | ccr_two = pccc.ConventionalCommitRunner() 211 | ccr_two.options.load(["--config", fn] + data["cli"]) 212 | fs.remove_object(fn) 213 | 214 | # Assert ``Config().__repr__()`` are equal. 215 | ccr_one.options.set_format("TOML") 216 | ccr_two.options.set_format("TOML") 217 | assert repr(ccr_one.options) == re.sub( 218 | r"two\.toml", "one.toml", repr(ccr_two.options) 219 | ) 220 | 221 | # Assert ``Config().__str__()`` are equal. 222 | ccr_one.options.set_format("TOML") 223 | ccr_two.options.set_format("TOML") 224 | assert str(ccr_one.options) == str(ccr_two.options) 225 | ccr_one.options.set_format("JSON") 226 | ccr_two.options.set_format("JSON") 227 | assert str(ccr_one.options) == str(ccr_two.options) 228 | 229 | # Use the fixture's JSON to write a JSON file, then load the JSON 230 | # and write a second file. Then, assert that the two ``Config()`` 231 | # objects have equal reproductions and string representations. 232 | fn = "one.json" 233 | fs.create_file(fn) 234 | with open(fn, "w") as f: 235 | json.dump({"pccc": data["pccc"]}, f, indent=2) 236 | 237 | ccr_three = pccc.ConventionalCommitRunner() 238 | ccr_three.options.load(["--config", fn] + data["cli"]) 239 | fs.remove_object(fn) 240 | 241 | fn = "two.json" 242 | fs.create_file(fn) 243 | with open(fn, "w") as f: 244 | ccr_three.options.set_format("JSON") 245 | f.write(str(ccr_three.options)) 246 | 247 | ccr_four = pccc.ConventionalCommitRunner() 248 | ccr_four.options.load(["--config", fn] + data["cli"]) 249 | fs.remove_object(fn) 250 | 251 | # Assert ``Config().__repr__()`` are equal. 252 | ccr_three.options.set_format("TOML") 253 | ccr_four.options.set_format("TOML") 254 | assert repr(ccr_three.options) == re.sub( 255 | r"two\.json", "one.json", repr(ccr_four.options) 256 | ) 257 | 258 | # Assert ``Config().__str__()`` are equal. 259 | ccr_three.options.set_format("TOML") 260 | ccr_four.options.set_format("TOML") 261 | assert str(ccr_three.options) == str(ccr_four.options) 262 | ccr_three.options.set_format("JSON") 263 | ccr_four.options.set_format("JSON") 264 | assert str(ccr_three.options) == str(ccr_four.options) 265 | 266 | # Mixed case: TOML, then JSON. 267 | fn = "one.toml" 268 | fs.create_file(fn) 269 | with open(fn, "w") as f: 270 | toml.dump({"pccc": data["pccc"]}, f) 271 | 272 | ccr_one = pccc.ConventionalCommitRunner() 273 | ccr_one.options.load(["--config", fn] + data["cli"]) 274 | fs.remove_object(fn) 275 | 276 | fn = "two.json" 277 | fs.create_file(fn) 278 | with open(fn, "w") as f: 279 | ccr_one.options.set_format("JSON") 280 | f.write(str(ccr_one.options)) 281 | 282 | ccr_two = pccc.ConventionalCommitRunner() 283 | ccr_two.options.load(["--config", fn] + data["cli"]) 284 | fs.remove_object(fn) 285 | 286 | # Assert ``Config().__repr__()`` are equal. 287 | ccr_one.options.set_format("TOML") 288 | ccr_two.options.set_format("TOML") 289 | assert repr(ccr_one.options) == re.sub( 290 | r"two\.json", "one.toml", repr(ccr_two.options) 291 | ) 292 | 293 | # Assert ``Config().__str__()`` are equal. 294 | ccr_one.options.set_format("TOML") 295 | ccr_two.options.set_format("TOML") 296 | assert str(ccr_one.options) == str(ccr_two.options) 297 | ccr_one.options.set_format("JSON") 298 | ccr_two.options.set_format("JSON") 299 | assert str(ccr_one.options) == str(ccr_two.options) 300 | 301 | # Mixed case: JSON, then TOML. 302 | fn = "one.json" 303 | fs.create_file(fn) 304 | with open(fn, "w") as f: 305 | json.dump({"pccc": data["pccc"]}, f, indent=2) 306 | 307 | ccr_one = pccc.ConventionalCommitRunner() 308 | ccr_one.options.load(["--config", fn] + data["cli"]) 309 | fs.remove_object(fn) 310 | 311 | fn = "two.toml" 312 | fs.create_file(fn) 313 | with open(fn, "w") as f: 314 | ccr_one.options.set_format("TOML") 315 | f.write(str(ccr_one.options)) 316 | 317 | ccr_two = pccc.ConventionalCommitRunner() 318 | ccr_two.options.load(["--config", fn] + data["cli"]) 319 | fs.remove_object(fn) 320 | 321 | # Assert ``Config().__repr__()`` are equal. 322 | ccr_one.options.set_format("TOML") 323 | ccr_two.options.set_format("TOML") 324 | assert repr(ccr_one.options) == re.sub( 325 | r"two\.toml", "one.json", repr(ccr_two.options) 326 | ) 327 | 328 | # Assert ``Config().__str__()`` are equal. 329 | ccr_one.options.set_format("TOML") 330 | ccr_two.options.set_format("TOML") 331 | assert str(ccr_one.options) == str(ccr_two.options) 332 | ccr_one.options.set_format("JSON") 333 | ccr_two.options.set_format("JSON") 334 | assert str(ccr_one.options) == str(ccr_two.options) 335 | 336 | 337 | @pytest.mark.parametrize( 338 | "fn, data", 339 | load_configuration_data(), 340 | ) 341 | def test_config_validate(fn, data, fs): 342 | """Test Config().validate().""" 343 | files = [] 344 | 345 | # TOML files. 346 | toml_files = [ 347 | "pyproject.toml", 348 | "config.toml", 349 | "config-one", 350 | ] 351 | 352 | for file in toml_files: 353 | files.append(file) 354 | fs.create_file(file) 355 | with open(file, "w") as f: 356 | if "pyproject.toml" not in file: 357 | data["pyproject"] = re.sub( 358 | r"\[tool\.pccc\]", "[pccc]", data["pyproject"] 359 | ) 360 | f.write(data["pyproject"]) 361 | 362 | # JSON files. 363 | json_files = [ 364 | "package.json", 365 | "config.json", 366 | "config-two", 367 | ] 368 | 369 | for file in json_files: 370 | files.append(file) 371 | fs.create_file(file) 372 | with open(file, "w") as f: 373 | json.dump(data, f, indent=2) 374 | 375 | for file in files: 376 | ccr = pccc.ConventionalCommitRunner() 377 | ccr.options.load(["--config", file] + data["cli"]) 378 | 379 | if data["valid"]: 380 | assert ccr.options.validate() is True 381 | else: 382 | with pytest.raises(ValueError): 383 | ccr.options.validate() 384 | 385 | 386 | # Create files with different body lengths and test the correct one is 387 | # loaded. 388 | def test_config_file_loading_order(fs): 389 | """Should load configuration files in correct order.""" 390 | i = 60 391 | 392 | # TOML. 393 | for filename in ( 394 | "custom.toml", 395 | "pyproject.toml", 396 | "pccc.toml", 397 | ): 398 | fs.create_file(filename) 399 | i += 1 400 | with open(filename, "w") as file: 401 | if "pyproject.toml" in filename: 402 | file.write(f"[tool.pccc]\n\nbody_length = {i}\n") 403 | else: 404 | file.write(f"[pccc]\n\nbody_length = {i}\n") 405 | 406 | # JSON. 407 | for filename in ( 408 | "package.json", 409 | "pccc.json", 410 | ): 411 | fs.create_file(filename) 412 | i += 1 413 | with open(filename, "w") as file: 414 | file.write(f'{{"pccc": {{\n "body_length": {i}\n}}\n}}\n') 415 | 416 | # Not implemented. 417 | # YAML. 418 | # BespON. 419 | 420 | files = [ 421 | "custom.toml", 422 | "pyproject.toml", 423 | "pccc.toml", 424 | "package.json", 425 | "pccc.json", 426 | # "pccc.yaml", 427 | # "pccc.yml", 428 | # "pccc.besp", 429 | ] 430 | 431 | i = 60 432 | for file in files: 433 | ccr = pccc.ConventionalCommitRunner() 434 | ccr.options.load(["--config", "custom.toml"]) 435 | i += 1 436 | assert ccr.options.body_length == i 437 | fs.remove_object(file) 438 | 439 | 440 | def test_no_config_files(fs): 441 | """Should use defaults if no configuration files.""" 442 | ccr = pccc.ConventionalCommitRunner() 443 | ccr.options.load("") 444 | 445 | assert ccr.options.header_length == 50 446 | assert ccr.options.body_length == 72 447 | 448 | 449 | def test_malformed_config_file(capsys, fs): 450 | """Should use defaults with malformed configuration files.""" 451 | ccr = pccc.ConventionalCommitRunner() 452 | 453 | # Hot garbage. 454 | fn = "hot-garbage" 455 | fs.create_file(fn) 456 | with open(fn, "w") as f: 457 | f.write("This file is hot garbage.\n") 458 | 459 | ccr.options.load(["--config", fn]) 460 | assert ccr.options.header_length == 50 461 | assert ccr.options.body_length == 72 462 | 463 | 464 | def test_nonexistent_config_files(): 465 | """Should use defaults with non-existent configuration files.""" 466 | files = [ 467 | "no.toml", 468 | "no.json", 469 | "no.yaml", 470 | "no.besp", 471 | ] 472 | 473 | for file in files: 474 | ccr = pccc.ConventionalCommitRunner() 475 | ccr.options.load(["--config", file]) 476 | 477 | assert ccr.options.header_length == 50 478 | assert ccr.options.body_length == 72 479 | 480 | 481 | def test__determine_file_format_toml(fs): 482 | """Should identify a TOML file.""" 483 | filename = "config.toml" 484 | fs.create_file(filename) 485 | with open(filename, "w") as file: 486 | # tdata = {"pccc": str(ccr.options)} 487 | tdata = { 488 | "pccc": { 489 | "header_length": 50, 490 | "body_length": 72, 491 | }, 492 | } 493 | toml.dump(tdata, file) 494 | 495 | assert pccc._determine_file_format(filename) == "toml" 496 | 497 | 498 | def test__determine_file_format_json(fs): 499 | """Should identify a JSON file.""" 500 | filename = "config.toml" 501 | fs.create_file(filename) 502 | with open(filename, "w") as file: 503 | data = { 504 | "pccc": { 505 | "header_length": 50, 506 | "body_length": 72, 507 | }, 508 | } 509 | json.dump(data, file) 510 | 511 | assert pccc._determine_file_format(filename) == "json" 512 | 513 | 514 | def test__determine_file_format_yaml(fs): 515 | """Should identify a YAML file.""" 516 | filename = "config.yaml" 517 | fs.create_file(filename) 518 | with open(filename, "w") as file: 519 | data = { 520 | "pccc": { 521 | "header_length": 50, 522 | "body_length": 72, 523 | }, 524 | } 525 | 526 | yaml = YAML(typ="safe") 527 | yaml.dump(data, file) 528 | 529 | with pytest.raises(ValueError): 530 | pccc._determine_file_format(filename) 531 | 532 | 533 | def test__determine_file_format_bespon(fs): 534 | """Should identify a BespON file.""" 535 | filename = "config.besp" 536 | fs.create_file(filename) 537 | with open(filename, "w") as file: 538 | data = { 539 | "pccc": { 540 | "header_length": 50, 541 | "body_length": 72, 542 | }, 543 | } 544 | 545 | bespon.dump(data, file) 546 | 547 | with pytest.raises(ValueError): 548 | pccc._determine_file_format(filename) 549 | 550 | 551 | def test__determine_file_format_no_file(fs): 552 | """Should raise ``FileNotFoundError``.""" 553 | filename = "not.here" 554 | 555 | with pytest.raises(FileNotFoundError): 556 | pccc._determine_file_format(filename) 557 | 558 | 559 | def test__load_toml_file(fs): 560 | """Should load a TOML file.""" 561 | filename = "config.toml" 562 | fs.create_file(filename) 563 | with open(filename, "w") as file: 564 | data = { 565 | "pccc": { 566 | "header_length": 48, 567 | "body_length": 68, 568 | }, 569 | } 570 | toml.dump(data, file) 571 | 572 | options = pccc._load_toml_file(filename) 573 | 574 | assert options["header_length"] == 48 575 | assert options["body_length"] == 68 576 | 577 | 578 | def test__load_toml_file_bad_format(fs): 579 | """Should raise ``TomlDecodeError``.""" 580 | filename = "config.toml" 581 | fs.create_file(filename) 582 | with open(filename, "w") as file: 583 | data = { 584 | "pccc": { 585 | "header_length": 48, 586 | "body_length": 68, 587 | }, 588 | } 589 | json.dump(data, file) 590 | 591 | with pytest.raises(toml.TomlDecodeError): 592 | pccc._load_toml_file(filename) 593 | 594 | 595 | def test__load_toml_file_no_file(fs): 596 | """Should raise ``FileNotFoundError``.""" 597 | filename = "not.here" 598 | 599 | with pytest.raises(FileNotFoundError): 600 | pccc._load_toml_file(filename) 601 | 602 | 603 | def test__load_json_file(fs): 604 | """Should load a JSON file.""" 605 | filename = "config.json" 606 | fs.create_file(filename) 607 | with open(filename, "w") as file: 608 | data = { 609 | "pccc": { 610 | "header_length": 48, 611 | "body_length": 68, 612 | }, 613 | } 614 | json.dump(data, file) 615 | 616 | options = pccc._load_json_file(filename) 617 | 618 | assert options["header_length"] == 48 619 | assert options["body_length"] == 68 620 | 621 | 622 | def test__load_json_file_bad_format(fs): 623 | """Should raise ``JSONDecodeError``.""" 624 | filename = "config.json" 625 | fs.create_file(filename) 626 | with open(filename, "w") as file: 627 | data = { 628 | "pccc": { 629 | "header_length": 48, 630 | "body_length": 68, 631 | }, 632 | } 633 | toml.dump(data, file) 634 | 635 | with pytest.raises(json.JSONDecodeError): 636 | pccc._load_json_file(filename) 637 | 638 | 639 | def test__load_json_file_no_file(fs): 640 | """Should raise ``FileNotFoundError``.""" 641 | filename = "not.here" 642 | 643 | with pytest.raises(FileNotFoundError): 644 | pccc._load_json_file(filename) 645 | 646 | 647 | def test__load_yaml_file(): 648 | """Should raise ``NotImplementedError``.""" 649 | filename = "not.here" 650 | 651 | with pytest.raises(NotImplementedError): 652 | pccc._load_yaml_file(filename) 653 | 654 | 655 | def test__load_bespon_file(): 656 | """Should raise ``NotImplementedError``.""" 657 | filename = "not.here" 658 | 659 | with pytest.raises(NotImplementedError): 660 | pccc._load_bespon_file(filename) 661 | 662 | 663 | def test_show_license_info(capsys): 664 | """Test ``--show-license`` and ``--show-warranty`` CLI options.""" 665 | expected = """\ 666 | pccc: The Python Conventional Commit Checker. 667 | 668 | Copyright (C) 2021-2022 Jeremy A Gray . 669 | 670 | This program is free software: you can redistribute it and/or modify it 671 | under the terms of the GNU General Public License as published by the 672 | Free Software Foundation, either version 3 of the License, or (at your 673 | option) any later version. 674 | 675 | This program is distributed in the hope that it will be useful, but 676 | WITHOUT ANY WARRANTY; without even the implied warranty of 677 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 678 | General Public License for more details. 679 | 680 | You should have received a copy of the GNU General Public License along 681 | with this program. If not, see . 682 | """ 683 | 684 | with pytest.raises(SystemExit): 685 | ccr = pccc.ConventionalCommitRunner() 686 | ccr.options.load(["--show-license"]) 687 | 688 | actual = capsys.readouterr().out 689 | 690 | assert actual == expected 691 | 692 | with pytest.raises(SystemExit): 693 | ccr = pccc.ConventionalCommitRunner() 694 | ccr.options.load(["--show-warranty"]) 695 | 696 | actual = capsys.readouterr().out 697 | 698 | assert actual == expected 699 | -------------------------------------------------------------------------------- /tests/test_exceptions.py: -------------------------------------------------------------------------------- 1 | # ****************************************************************************** 2 | # 3 | # pccc, the Python Conventional Commit Checker. 4 | # 5 | # SPDX-License-Identifier: GPL-3.0-or-later 6 | # 7 | # Copyright 2020-2022 Jeremy A Gray . 8 | # 9 | # ****************************************************************************** 10 | 11 | """pccc exception tests.""" 12 | 13 | import sys 14 | 15 | from hypothesis import given 16 | from hypothesis import strategies as st 17 | 18 | sys.path.insert(0, "/home/gray/src/work/pccc") 19 | 20 | import pccc # noqa: E402 21 | 22 | 23 | def test_stringify_closes_issue_parse_exception(): 24 | """Should stringify a ``pccc.ClosesIssueParseException()``.""" 25 | begin = "begin" 26 | bad = "x" 27 | end = "end" 28 | string = begin + bad + end 29 | location = len(begin) 30 | message = "error" 31 | element = None 32 | 33 | error = pccc.ClosesIssueParseException( 34 | string, 35 | location, 36 | message, 37 | element, 38 | ) 39 | 40 | assert str(error) == ( 41 | "One or more malformed Github issue references on or after" 42 | f" character position {location + 1} in" 43 | f'"{begin}[{bad}]{end}".' 44 | f"\nparseable: {begin}" 45 | f"\nunparseable: {bad + end}" 46 | ) 47 | 48 | 49 | def test_reproduce_closes_issue_parse_exception(): 50 | """Should reproduce a ``pccc.ClosesIssueParseException()``.""" 51 | begin = "begin" 52 | bad = "x" 53 | end = "end" 54 | string = begin + bad + end 55 | location = len(begin) 56 | message = "error" 57 | element = None 58 | 59 | error = pccc.ClosesIssueParseException( 60 | string, 61 | location, 62 | message, 63 | element, 64 | ) 65 | 66 | assert repr(error) == ( 67 | "ClosesIssueParseException(" 68 | f"string={repr(string)}," 69 | f" loc={repr(location)}," 70 | f" msg={repr(message)}," 71 | f" elem={repr(element)}," 72 | ")" 73 | ) 74 | 75 | 76 | @given(length=st.integers(min_value=71, max_value=100)) 77 | def test_stringify_header_length_error(length): 78 | """Should stringify a ``pccc.HeaderLengthError()``.""" 79 | max = 50 80 | header = ("fix(this): ********************************************",) 81 | 82 | error = pccc.HeaderLengthError( 83 | length, 84 | max, 85 | header, 86 | ) 87 | 88 | assert str(error) == ( 89 | f"Commit header length ({length}) exceeds the maximum length ({max})." 90 | ) 91 | 92 | 93 | @given( 94 | length=st.integers(min_value=80, max_value=120), 95 | max=st.integers(min_value=70, max_value=78), 96 | ) 97 | def test_reproduce_header_length_error(length, max): 98 | """Should reproduce a ``pccc.HeaderLengthError()``.""" 99 | header = ("fix(this): ********************************************",) 100 | 101 | error = pccc.HeaderLengthError( 102 | length, 103 | max, 104 | header, 105 | ) 106 | 107 | message = f"Commit header length ({length}) exceeds the maximum length ({max})." 108 | 109 | assert repr(error) == ( 110 | "HeaderLengthError(" 111 | f"length={repr(length)}," 112 | f" max_length={repr(max)}," 113 | f" header={repr(header)}," 114 | f" message={repr(message)}," 115 | ")" 116 | ) 117 | 118 | 119 | @given( 120 | length=st.integers(min_value=80, max_value=120), 121 | max=st.integers(min_value=70, max_value=78), 122 | ) 123 | def test_stringify_body_length_error(length, max): 124 | """Should stringify a ``pccc.BodyLengthError()``.""" 125 | error = pccc.BodyLengthError( 126 | length, 127 | max, 128 | ) 129 | 130 | assert str(error) == ( 131 | f"Commit body length ({length}) exceeds the maximum length ({max})." 132 | ) 133 | 134 | 135 | @given( 136 | length=st.integers(min_value=80, max_value=120), 137 | max=st.integers(min_value=70, max_value=78), 138 | ) 139 | def test_reproduce_body_length_error(length, max): 140 | """Should reproduce a ``pccc.BodyLengthError()``.""" 141 | error = pccc.BodyLengthError( 142 | length, 143 | max, 144 | ) 145 | 146 | message = f"Commit body length ({length}) exceeds the maximum length ({max})." 147 | 148 | assert repr(error) == ( 149 | "BodyLengthError(" 150 | f"longest={repr(length)}," 151 | f" max_length={repr(max)}," 152 | f" message={repr(message)}," 153 | ")" 154 | ) 155 | 156 | 157 | @given( 158 | length=st.integers(min_value=80, max_value=120), 159 | max=st.integers(min_value=70, max_value=78), 160 | ) 161 | def test_stringify_breaking_length_error(length, max): 162 | """Should stringify a ``pccc.BreakingLengthError()``.""" 163 | error = pccc.BreakingLengthError( 164 | length, 165 | max, 166 | ) 167 | 168 | assert str(error) == ( 169 | f"Commit breaking change length ({length}) exceeds the maximum length ({max})." 170 | ) 171 | 172 | 173 | @given( 174 | length=st.integers(min_value=80, max_value=120), 175 | max=st.integers(min_value=70, max_value=78), 176 | ) 177 | def test_reproduce_breaking_length_error(length, max): 178 | """Should reproduce a ``pccc.BreakingLengthError()``.""" 179 | error = pccc.BreakingLengthError( 180 | length, 181 | max, 182 | ) 183 | 184 | message = ( 185 | f"Commit breaking change length ({length}) exceeds the maximum length ({max})." 186 | ) 187 | 188 | assert repr(error) == ( 189 | "BreakingLengthError(" 190 | f"longest={repr(length)}," 191 | f" max_length={repr(max)}," 192 | f" message={repr(message)}," 193 | ")" 194 | ) 195 | -------------------------------------------------------------------------------- /tests/test_parser.py: -------------------------------------------------------------------------------- 1 | # ****************************************************************************** 2 | # 3 | # pccc, the Python Conventional Commit Checker. 4 | # 5 | # SPDX-License-Identifier: GPL-3.0-or-later 6 | # 7 | # Copyright 2020-2023 Jeremy A Gray . 8 | # 9 | # ****************************************************************************** 10 | 11 | """pccc parser tests.""" 12 | 13 | import io 14 | import json 15 | import os 16 | import random 17 | import re 18 | import sys 19 | 20 | import pyparsing as pp 21 | import pytest 22 | from hypothesis import given 23 | from hypothesis import strategies as st 24 | 25 | sys.path.insert(0, "/home/gray/src/work/pccc") 26 | 27 | import pccc # noqa: E402 28 | 29 | 30 | def get_commits(): 31 | """Load commit data for tests.""" 32 | data = [] 33 | json_file_re = re.compile(r"\d{4}\.json$") 34 | 35 | with os.scandir("./tests/parser") as dir: 36 | for entry in dir: 37 | if entry.is_file() and json_file_re.match(entry.name): 38 | datum = [] 39 | with open(entry.path, "r") as file: 40 | try: 41 | datum.append(json.load(file)) 42 | except json.JSONDecodeError as error: 43 | print(f"JSON error in file {entry.name}") 44 | raise error 45 | datum[0]["filename"] = entry.name 46 | data.append(tuple([entry.path, datum])) 47 | 48 | return data 49 | 50 | 51 | @pytest.fixture 52 | def config(): 53 | """Load configuration file.""" 54 | fn = "./pyproject.toml" 55 | with open(fn, "r") as f: 56 | conf_data = f.read() 57 | 58 | return conf_data 59 | 60 | 61 | @st.composite 62 | def commit(draw): 63 | """Generate a commit object strategy.""" 64 | footers = draw( 65 | st.lists( 66 | st.text( 67 | st.characters( 68 | whitelist_categories=("L", "N"), 69 | blacklist_categories=("C"), 70 | ), 71 | min_size=3, 72 | max_size=10, 73 | ), 74 | unique=True, 75 | ) 76 | ) 77 | 78 | conf = pccc.Config( 79 | header_length=draw(st.integers(min_value=50, max_value=50)), 80 | body_length=draw(st.integers(min_value=70, max_value=120)), 81 | repair=draw(st.booleans()), 82 | wrap=draw(st.booleans()), 83 | force_wrap=draw(st.booleans()), 84 | spell_check=draw(st.booleans()), 85 | ignore_generated_commits=draw(st.booleans()), 86 | generated_commits=draw( 87 | st.lists( 88 | st.text( 89 | st.characters( 90 | whitelist_categories=("L", "N", "P"), 91 | blacklist_categories=("C"), 92 | ), 93 | min_size=3, 94 | max_size=10, 95 | ), 96 | unique=True, 97 | ) 98 | ), 99 | types=draw( 100 | st.lists( 101 | st.text( 102 | st.characters( 103 | whitelist_categories=("L", "N"), 104 | blacklist_categories=("C"), 105 | ), 106 | min_size=3, 107 | max_size=10, 108 | ), 109 | unique=True, 110 | min_size=2, 111 | max_size=8, 112 | ) 113 | ), 114 | scopes=draw( 115 | st.lists( 116 | st.text( 117 | st.characters( 118 | whitelist_categories=("L", "N"), 119 | blacklist_categories=("C"), 120 | ), 121 | min_size=3, 122 | max_size=10, 123 | ), 124 | unique=True, 125 | min_size=3, 126 | max_size=8, 127 | ) 128 | ), 129 | footers=footers, 130 | required_footers=footers, 131 | ) 132 | 133 | commit = pccc.ConventionalCommitRunner() 134 | commit.options = conf 135 | type = random.choice(commit.options.types) 136 | scope = random.choice(commit.options.scopes) 137 | description = draw( 138 | st.text( 139 | st.characters( 140 | whitelist_categories=("L", "N"), 141 | blacklist_categories=("C"), 142 | ), 143 | min_size=20, 144 | max_size=50 - (len(type) + len(scope) + 4), 145 | ) 146 | ) 147 | message = draw( 148 | st.text( 149 | st.characters( 150 | whitelist_categories=("L", "N"), 151 | blacklist_categories=("C"), 152 | ), 153 | min_size=50, 154 | max_size=500, 155 | ) 156 | ) 157 | 158 | commit.raw = f"""{type}({scope}): {description} 159 | 160 | {message} 161 | """ 162 | 163 | return commit 164 | 165 | 166 | @given(commit=commit()) 167 | def test_generated_commit(commit): 168 | """Should do something.""" 169 | commit.clean() 170 | commit.parse() 171 | 172 | header = commit.raw.split("\n")[0] 173 | (type, scope) = header.split(":")[0].split("(") 174 | scope = scope.split(")")[0] 175 | print(f"type: {type} {commit.header['type']}") 176 | print(f"scope: {scope} {commit.header['scope']}") 177 | 178 | assert type == commit.header["type"] 179 | assert scope == commit.header["scope"] 180 | 181 | 182 | @pytest.mark.parametrize( 183 | "fn, obj", 184 | get_commits(), 185 | ) 186 | def test_commits(fn, obj): 187 | """Test commits.""" 188 | ccr = pccc.ConventionalCommitRunner() 189 | ccr.options.load("") 190 | ccr.raw = obj[0]["raw"] 191 | ccr.clean() 192 | 193 | if obj[0]["parseable"]: 194 | ccr.parse() 195 | 196 | assert ccr.header == obj[0]["header"] 197 | # assert ccr.breaking == obj[0]["breaking"] 198 | assert ccr.footers == obj[0]["footers"] 199 | 200 | assert str(ccr) == obj[0]["parsed"] 201 | assert repr(ccr) == rf"ConventionalCommit(raw={ccr.raw})" 202 | 203 | # Check closes issues. 204 | if "closes_issues" in obj[0]: 205 | assert ccr.closes_issues == obj[0]["closes_issues"] 206 | 207 | # Check header length. 208 | if obj[0]["header"]["length"] > 50: 209 | with pytest.raises(ValueError): 210 | ccr.validate_header_length() 211 | else: 212 | assert ccr.validate_header_length() is True 213 | 214 | # Check body. 215 | ccr.options.wrap = False 216 | ccr.options.force_wrap = False 217 | if obj[0]["body"]["longest"] > 72 and obj[0]["breaking"]["longest"] > 72: 218 | with pytest.raises(pccc.BodyLengthError): 219 | ccr.validate() 220 | elif obj[0]["body"]["longest"] > 72 and obj[0]["breaking"]["longest"] <= 72: 221 | with pytest.raises(pccc.BodyLengthError): 222 | ccr.validate() 223 | elif obj[0]["body"]["longest"] <= 72 and obj[0]["breaking"]["longest"] > 72: 224 | with pytest.raises(pccc.BreakingLengthError): 225 | ccr.validate() 226 | else: 227 | assert ccr.validate_body_length() is True 228 | assert ccr.validate_breaking_length() is True 229 | assert ccr.breaking == obj[0]["breaking"] 230 | assert ccr.body == obj[0]["body"] 231 | 232 | ccr.options.wrap = True 233 | for length in (72, 70): 234 | if str(length) in obj[0]: 235 | ccr.options.body_length = length 236 | assert ccr.validate() is True 237 | assert ccr.body == obj[0][str(length)]["body"] 238 | print(length) 239 | print(ccr.breaking) 240 | print(obj[0][str(length)]["breaking"]) 241 | assert ccr.breaking == obj[0][str(length)]["breaking"] 242 | 243 | ccr.options.force_wrap = True 244 | for length in (72, 70): 245 | if str(length) in obj[0]: 246 | ccr.options.body_length = length 247 | assert ccr.validate() is True 248 | ccr.post_process() 249 | assert ccr.body == obj[0][str(length)]["body"] 250 | assert ccr.breaking == obj[0][str(length)]["breaking"] 251 | 252 | for length in (70, 72): 253 | if str(length) in obj[0]: 254 | ccr.options.body_length = length 255 | assert ccr.validate() is True 256 | ccr.post_process() 257 | assert ccr.body == obj[0][str(length)]["body"] 258 | assert ccr.breaking == obj[0][str(length)]["breaking"] 259 | 260 | else: 261 | with pytest.raises(pp.ParseBaseException): 262 | ccr.parse() 263 | 264 | 265 | @pytest.mark.parametrize( 266 | "fn, obj", 267 | get_commits(), 268 | ) 269 | def test_main_file(config, fn, obj, fs, capsys): 270 | """Test pccc.main() with commits from files.""" 271 | # Commit message. 272 | fn = "./pyproject.toml" 273 | fs.create_file(fn) 274 | with open(fn, "w") as file: 275 | file.write(config) 276 | 277 | # Commit message. 278 | fn = "./commit-msg" 279 | fs.create_file(fn) 280 | with open(fn, "w") as file: 281 | file.write(obj[0]["raw"]) 282 | 283 | if obj[0]["parseable"]: 284 | if not ("header_length" in obj[0]["errors"]): 285 | with pytest.raises(SystemExit) as error: 286 | pccc.main([fn]) 287 | capture = capsys.readouterr() 288 | assert capture.out == "" 289 | assert error.type == SystemExit 290 | assert error.value.code == 0 291 | else: 292 | with pytest.raises(SystemExit) as error: 293 | pccc.main([fn]) 294 | capture = capsys.readouterr() 295 | assert capture.out[:-1] == obj[0]["raw"] 296 | assert error.type == SystemExit 297 | assert error.value.code == 1 298 | else: 299 | if "generated" in obj[0] and obj[0]["generated"]: 300 | obj[0]["generated"] 301 | with pytest.raises(SystemExit) as error: 302 | pccc.main([fn]) 303 | assert error.type == SystemExit 304 | assert error.value.code == 0 305 | else: 306 | with pytest.raises(SystemExit) as error: 307 | pccc.main([fn]) 308 | capture = capsys.readouterr() 309 | assert capture.out[:-1] == obj[0]["raw"] 310 | assert error.type == SystemExit 311 | assert error.value.code == 1 312 | 313 | 314 | @pytest.mark.parametrize( 315 | "fn, obj", 316 | get_commits(), 317 | ) 318 | def test_main_stdin(config, fn, obj, monkeypatch, fs): 319 | """Test pccc.main() with commits from STDIN.""" 320 | # Configuration file. 321 | fn = "./pyproject.toml" 322 | fs.create_file(fn) 323 | with open(fn, "w") as file: 324 | file.write(config) 325 | 326 | monkeypatch.setattr("sys.stdin", io.StringIO(obj[0]["raw"])) 327 | 328 | if obj[0]["parseable"]: 329 | if not ("header_length" in obj[0]["errors"]): 330 | with pytest.raises(SystemExit) as error: 331 | pccc.main([]) 332 | assert error.type == SystemExit 333 | assert error.value.code == 0 334 | else: 335 | with pytest.raises(SystemExit) as error: 336 | pccc.main([]) 337 | assert error.type == SystemExit 338 | assert error.value.code == 1 339 | else: 340 | try: 341 | obj[0]["generated"] 342 | with pytest.raises(SystemExit) as error: 343 | pccc.main([]) 344 | assert error.type == SystemExit 345 | assert error.value.code == 0 346 | except KeyError: 347 | with pytest.raises(SystemExit) as error: 348 | pccc.main([]) 349 | assert error.type == SystemExit 350 | assert error.value.code == 1 351 | 352 | 353 | def test_load_nonexistent_commit_file(): 354 | """Test loading a non-existent commit file.""" 355 | ccr = pccc.ConventionalCommitRunner() 356 | ccr.options.load("") 357 | ccr.options.validate() 358 | 359 | ccr.options.commit = "./tests/parser/nothere.json" 360 | 361 | with pytest.raises(FileNotFoundError): 362 | ccr.get() 363 | -------------------------------------------------------------------------------- /tests/test_spelling.py: -------------------------------------------------------------------------------- 1 | # ****************************************************************************** 2 | # 3 | # pccc, the Python Conventional Commit Checker. 4 | # 5 | # SPDX-License-Identifier: GPL-3.0-or-later 6 | # 7 | # Copyright 2020-2023 Jeremy A Gray . 8 | # 9 | # ****************************************************************************** 10 | 11 | """pccc parser spell checking tests.""" 12 | 13 | import sys 14 | 15 | import pytest 16 | from hypothesis import given 17 | from hypothesis import strategies as st 18 | 19 | sys.path.insert(0, "/home/gray/src/work/pccc") 20 | 21 | import pccc # noqa: E402 22 | 23 | 24 | @given( 25 | words=st.lists( 26 | st.text( 27 | min_size=1, 28 | alphabet=st.characters( 29 | whitelist_categories=( 30 | "Lu", 31 | "Ll", 32 | ) 33 | ), 34 | ), 35 | ), 36 | ) 37 | def test__add_spell_ignore_word(words): 38 | """Should add ignored words.""" 39 | ccr = pccc.ConventionalCommitRunner() 40 | ccr.options.load("") 41 | 42 | for word in words: 43 | line = f"# IGNORE: {word}" 44 | ccr._add_spell_ignore_word(line) 45 | 46 | assert word in ccr.spell_ignore_words 47 | 48 | 49 | @given( 50 | words=st.lists( 51 | st.text( 52 | min_size=1, 53 | alphabet=st.characters( 54 | whitelist_categories=( 55 | "Lu", 56 | "Ll", 57 | ) 58 | ), 59 | ), 60 | ), 61 | ) 62 | def test_clean_finds_ignored_words(words): 63 | """Should find ignored words.""" 64 | ccr = pccc.ConventionalCommitRunner() 65 | ccr.options.load("") 66 | ccr.raw = ( 67 | "feat(parser): add closing footer\n\n" 68 | "Add closing foter to allow github issue closing.\n" 69 | ) 70 | 71 | for word in words: 72 | line = f"# IGNORE: {word}\n" 73 | ccr.raw += line 74 | 75 | ccr.clean() 76 | 77 | for word in words: 78 | assert word in ccr.spell_ignore_words 79 | 80 | 81 | def test_spell_check_commit(): 82 | """Should find spelling errors.""" 83 | ccr = pccc.ConventionalCommitRunner() 84 | ccr.options.load("") 85 | ccr.options.spell_check = True 86 | ccr.raw = ( 87 | "feat(parser): add closing footer\n\n" 88 | "Add closing foter to allow github issue closing.\n" 89 | ) 90 | ccr.clean() 91 | ccr.parse() 92 | ccr.validate() 93 | ccr.post_process() 94 | 95 | assert "# ERROR: foter" in ccr.errors 96 | assert "# ERROR: github" in ccr.errors 97 | 98 | 99 | def test_spell_check_commit_main(fs, capsys): 100 | """Should handle spelling error interaction.""" 101 | # Commit message. 102 | fn = "./pyproject.toml" 103 | fs.create_file(fn) 104 | with open(fn, "w") as file: 105 | file.write( 106 | r"""[tool.pccc] 107 | 108 | header_length = 50 109 | body_length = 72 110 | wrap = true 111 | force_wrap = true 112 | spell_check = true 113 | repair = false 114 | ignore_generated_commits = true 115 | 116 | generated_commits = [ 117 | '''^\(tag:\s+v\d+\.\d+\.\d\)\s+\d+\.\d+\.\d+$''', 118 | '''^Merge branch 'master' of.*$''', 119 | ] 120 | 121 | types = [ 122 | "build", 123 | "ci", 124 | "depends", 125 | "docs", 126 | "feat", 127 | "fix", 128 | "perf", 129 | "refactor", 130 | "release", 131 | "style", 132 | "test", 133 | ] 134 | 135 | scopes = [ 136 | "config", 137 | "docs", 138 | "parser", 139 | "tooling", 140 | ] 141 | 142 | footers = [ 143 | "github-closes", 144 | "signed-off-by", 145 | ] 146 | 147 | required_footers = [ 148 | "signed-off-by", 149 | ] 150 | """ 151 | ) 152 | 153 | # Commit message. 154 | fn = "./commit-msg" 155 | fs.create_file(fn) 156 | with open(fn, "w") as file: 157 | file.write( 158 | "feat(parser): add closing footer\n\n" 159 | "Add closing foter to allow github issue closing.\n" 160 | ) 161 | 162 | with pytest.raises(SystemExit) as error: 163 | pccc.main([fn]) 164 | 165 | capture = capsys.readouterr() 166 | assert "# ERROR: foter" in capture.out 167 | assert "# IGNORE: foter" in capture.out 168 | assert "# ERROR: github" in capture.out 169 | assert "# IGNORE: github" in capture.out 170 | assert error.type == SystemExit 171 | assert error.value.code == 1 172 | -------------------------------------------------------------------------------- /tox.ini: -------------------------------------------------------------------------------- 1 | #*********************************************************************** 2 | # 3 | # pccc, the Python Conventional Commit Checker. 4 | # 5 | # SPDX-License-Identifier: GPL-3.0-or-later 6 | # 7 | # Copyright 2020-2022 Jeremy A Gray . 8 | # 9 | #*********************************************************************** 10 | 11 | [tox] 12 | 13 | envlist = 14 | # Erase old test coverage data. 15 | clean 16 | # Python versions. 17 | py{37,38,39,310,311} 18 | # Generate current test coverage report. 19 | report 20 | # Linting 21 | lint 22 | 23 | isolated_build = True 24 | skip_missing_interpreters = True 25 | requires = 26 | pip>=20.0 27 | 28 | [testenv:clean] 29 | 30 | # Erase previous test coverage data. 31 | 32 | deps = coverage[TOML] 33 | skip_install = true 34 | commands = coverage erase 35 | 36 | [testenv:report] 37 | 38 | # Generate current test coverage report. 39 | 40 | deps = coverage[TOML] 41 | skip_install = true 42 | commands = 43 | coverage report 44 | coverage html 45 | 46 | [testenv] 47 | 48 | # Test supported environments. 49 | 50 | deps = 51 | bespon 52 | factory-boy 53 | hypothesis 54 | pyenchant 55 | pyfakefs 56 | pyparsing 57 | pytest 58 | pytest-cov 59 | ruamel.yaml 60 | toml 61 | commands = 62 | pytest -vv --cov pccc --cov tests --cov-append 63 | 64 | [testenv:flake8] 65 | 66 | skip_install = True 67 | deps = 68 | flake8 69 | flake8-docstrings 70 | commands = 71 | flake8 pccc tests 72 | 73 | [testenv:black] 74 | 75 | skip_install = True 76 | deps = 77 | black 78 | commands = 79 | black --check --diff pccc tests 80 | 81 | [testenv:isort] 82 | 83 | skip_install = True 84 | deps = 85 | isort 86 | commands = 87 | isort --check --df pccc tests 88 | 89 | [testenv:lint] 90 | 91 | skip_install = True 92 | deps = 93 | flake8 94 | flake8-docstrings 95 | black 96 | isort 97 | commands = 98 | black --check --diff pccc tests 99 | flake8 pccc tests 100 | isort --check --df pccc tests 101 | 102 | [testenv:lint-fix] 103 | 104 | skip_install = True 105 | deps = 106 | black 107 | isort 108 | commands = 109 | black pccc tests 110 | isort pccc tests 111 | --------------------------------------------------------------------------------