Welcome to Conventional Commit Sphinx Changelog’s documentation!¶
Conventional Commit Sphinx Changelog¶
Automatically generates a releases-style changelog based on conventional commit messages.
Free software: GNU General Public License v3
Documentation: https://convention-commits-sphinx.readthedocs.io.
Features¶
Add the following to your Sphinx ReST files to get an automatically generated changelog based upon conventional commit messages:
.. cc_changelog::
For more info on conventional commits, please see:
Here is an example of a changelog in git log --graph --oneline
form:
* 37b88f7 - (HEAD -> master, origin/master) docs(README): uses rtd link from project home (copy/paste) (64 seconds ago) <Paul Gierz>
* 2106914 - docs(readme): fixes double dot in badge link (oops) (5 minutes ago) <Paul Gierz>
* dba6788 - docs(README): fixes readme links (6 minutes ago) <Paul Gierz>
* 87e04fc - (tag: v0.6.1) bump: version 0.6.0 → 0.6.1 (19 minutes ago) <GitHub Action>
* afc76c2 - fix(setup.py): adds missing dependencies (20 minutes ago) <Paul Gierz>
* 3a5de72 - test(tox): removes tox test suite (20 minutes ago) <Paul Gierz>
* fa9923e - (tag: v0.6.0) bump: version 0.5.2 → 0.6.0 (26 minutes ago) <GitHub Action>
* 17137dc - feat: adds sphinx directive (27 minutes ago) <Paul Gierz>
* 1253061 - feat: adds optional printing of colors (default on) (28 minutes ago) <Paul Gierz>
* 60d2aa6 - (tag: v0.5.2) bump: version 0.5.1 → 0.5.2 (2 days ago) <GitHub Action>
* f025602 - refactor: moves main program into a simple function (2 days ago) <Paul Gierz>
* acf0e3f - style: applies black and isort (2 days ago) <Paul Gierz>
* 944e0b7 - docs: changes to rtd theme, adds heading to changelog (3 days ago) <Paul Gierz>
* 89ad1e5 - docs: adds formatted changelog to docs (3 days ago) <Paul Gierz>
* a09c9b0 - (tag: v0.5.1) bump: version 0.5.0 → 0.5.1 (3 days ago) <GitHub Action>
* 55dec48 - fix: fixes heading grouping logic (3 days ago) <Paul Gierz>
* 43a8501 - fix(setup.py): adds missing dependencies (3 days ago) <Paul Gierz>
* 8997fa7 - (tag: v0.5.0) bump: version 0.4.1 → 0.5.0 (3 days ago) <Paul Gierz>
* dff4e2f - Merge remote-tracking branch 'origin/master' (3 days ago) <Paul Gierz>
|\
| * d25017d - (tag: v0.4.1) bump: version 0.4.0 → 0.4.1 (4 days ago) <GitHub Action>
* | fb11339 - feat: adds color output and formats to stdout nicely (3 days ago) <Paul Gierz>
* | 0dc1750 - (origin/feature/funcs) refactor: puts everything into functions (3 days ago) <Paul Gierz>
|/
* 9ea4503 - ci: automatically publish to pypi when automatic bump occurs (4 days ago) <Paul Gierz>
* 06d4115 - fix: better implementation of getting commit messages (4 days ago) <Paul Gierz>
* 0d9a1e5 - (tag: v0.4.0) bump: version 0.3.0 → 0.4.0 (4 days ago) <GitHub Action>
* c9dd3c2 - feat: parses log and prints rST style release version summaries (4 days ago) <Paul Gierz>
* df12a50 - docs(changelog): changelog fixup (4 days ago) <Paul Gierz>
* 04209f6 - (tag: v0.3.0) bump: version 0.2.0 → 0.3.0 (4 days ago) <Paul Gierz>
* 75a190a - feat: automatic bump version on push (4 days ago) <Paul Gierz>
* c39e0fb - (tag: v0.2.0) bump: version 0.1.1 → 0.2.0 (4 days ago) <Paul Gierz>
* 72f506a - fix(tags): adds v prefix to tags (4 days ago) <Paul Gierz>
* 5724fb1 - ci: fixs tag publishing (4 days ago) <Paul Gierz>
* fbd165c - ci: removes travis ci (4 days ago) <Paul Gierz>
* 8b73303 - (tag: 0.1.1) bump: version 0.1.0 → 0.1.1 (4 days ago) <Paul Gierz>
* 839fb8d - fix(cz): fixup conventional commit bumping (4 days ago) <Paul Gierz>
* 2fc0466 - (tag: 0.1.0) bump: version 0.0.1 → 0.1.0 (4 days ago) <Paul Gierz>
* f78d28e - feat: initial commit (4 days ago) <Paul Gierz>
Roadmap¶
In the future, I’d like to include better formatting in Sphinx (preserve paragraphs), as well as automatically create links to issue numbers and releases.
Installation¶
Stable release¶
To install Conventional Commit Sphinx Changelog, run this command in your terminal:
$ pip install cc_sphinx_changelog
This is the preferred method to install Conventional Commit Sphinx Changelog, as it will always install the most recent stable release.
If you don’t have pip installed, this Python installation guide can guide you through the process.
From sources¶
The sources for Conventional Commit Sphinx Changelog can be downloaded from the Github repo.
You can either clone the public repository:
$ git clone git://github.com/pgierz/cc_sphinx_changelog
Or download the tarball:
$ curl -OL https://github.com/pgierz/cc_sphinx_changelog/tarball/master
Once you have a copy of the source, you can install it with:
$ python setup.py install
Contributing¶
Contributions are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given.
You can contribute in many ways:
Types of Contributions¶
Report Bugs¶
Report bugs at https://github.com/pgierz/cc_sphinx_changelog/issues.
If you are reporting a bug, please include:
Your operating system name and version.
Any details about your local setup that might be helpful in troubleshooting.
Detailed steps to reproduce the bug.
Fix Bugs¶
Look through the GitHub issues for bugs. Anything tagged with “bug” and “help wanted” is open to whoever wants to implement it.
Implement Features¶
Look through the GitHub issues for features. Anything tagged with “enhancement” and “help wanted” is open to whoever wants to implement it.
Write Documentation¶
Conventional Commit Sphinx Changelog could always use more documentation, whether as part of the official Conventional Commit Sphinx Changelog docs, in docstrings, or even on the web in blog posts, articles, and such.
Submit Feedback¶
The best way to send feedback is to file an issue at https://github.com/pgierz/cc_sphinx_changelog/issues.
If you are proposing a feature:
Explain in detail how it would work.
Keep the scope as narrow as possible, to make it easier to implement.
Remember that this is a volunteer-driven project, and that contributions are welcome :)
Get Started!¶
Ready to contribute? Here’s how to set up cc_sphinx_changelog for local development.
Fork the cc_sphinx_changelog repo on GitHub.
Clone your fork locally:
$ git clone git@github.com:your_name_here/cc_sphinx_changelog.git
Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development:
$ mkvirtualenv cc_sphinx_changelog $ cd cc_sphinx_changelog/ $ python setup.py develop
Create a branch for local development:
$ git checkout -b name-of-your-bugfix-or-feature
Now you can make your changes locally.
When you’re done making changes, check that your changes pass flake8 and the tests, including testing other Python versions with tox:
$ flake8 cc_sphinx_changelog tests $ python setup.py test or py.test $ tox
To get flake8 and tox, just pip install them into your virtualenv.
Commit your changes and push your branch to GitHub:
$ git add . $ git commit -m "Your detailed description of your changes." $ git push origin name-of-your-bugfix-or-feature
Submit a pull request through the GitHub website.
Pull Request Guidelines¶
Before you submit a pull request, check that it meets these guidelines:
The pull request should include tests.
If the pull request adds functionality, the docs should be updated. Put your new functionality into a function with a docstring, and add the feature to the list in README.rst.
The pull request should work for Python 2.7, 3.4, 3.5 and 3.6, and for PyPy. Check https://travis-ci.org/pgierz/cc_sphinx_changelog/pull_requests and make sure that the tests pass for all supported Python versions.
Deploying¶
A reminder for the maintainers on how to deploy. Make sure all your changes are committed (including an entry in HISTORY.rst). Then run:
$ bumpversion patch # possible: major / minor / patch
$ git push
$ git push --tags
Travis will then deploy to PyPI if tests pass.
Changelog¶
Unreleased¶
Support¶
137d0fa [README] provides examples of git log and adds a roadmap
37b88f7 [README] uses rtd link from project home (copy/paste)
2106914 [readme] fixes double dot in badge link (oops)
dba6788 [README] fixes readme links
0.6.1¶
Bug Fix¶
afc76c2 [setup.py] adds missing dependencies
Unknown¶
3a5de72 [tox] removes tox test suite
0.6.0¶
New Features¶
17137dc adds sphinx directive Adds a Sphinx directive via
.. cc_changelog::
which can be used to automatically build a changelog in Sphinx based upon commit history. Closes #11253061 adds optional printing of colors (default on)
0.5.2¶
Support¶
f025602 moves main program into a simple function
944e0b7 changes to rtd theme, adds heading to changelog
89ad1e5 adds formatted changelog to docs Adds the formatted changelog produced by the program output to the documentation (one-time only). This serves as a test for how it will render online, adding links will not yet be included.
Unknown¶
acf0e3f applies black and isort
0.5.1¶
Bug Fixes¶
55dec48 fixes heading grouping logic The grouping logic in the heading formatting function was incorrect, and retrieved a string
Unknown
rather than the list theUnknown
key was pointing to. Closes #343a8501 [setup.py] adds missing dependencies Closes #4
0.5.0¶
New Feature¶
fb11339 adds color output and formats to stdout nicely Closes #2
Support¶
0dc1750 puts everything into functions
Unknown¶
dff4e2f
0.4.1¶
Bug Fix¶
06d4115 better implementation of getting commit messages The previous implementation was looking at
git.head.log()
, which did not register all commits as commits, some rather as pull or merge. Now we directly iterate over commits and extract the log message. This also preserves body parts of the message.
Support¶
9ea4503 automatically publish to pypi when automatic bump occurs
0.4.0¶
New Feature¶
c9dd3c2 parses log and prints rST style release version summaries This parses the log, gives headers based upon ‘bump: ‘, and gathers each commit in a bullet point list. Next step is to parse type of change.
Support¶
df12a50 [changelog] changelog fixup