The 0.10.0 release adds the ability to ignore commits based on their contents, support for pre-commit, and important fix for running gitlint in CI environments (such as Jenkins, Gitlab, etc).
Special thanks to @asottile, @bdrung, @pbregener, @torwald-sergesson, @RykHawthorn, @SteffenKockel and @tommyip for their contributions.
Since it's becoming increasingly hard to support Python 2.6 and 3.3, we'd like to encourage our users to upgrade their python version to 2.7 or 3.3+. Future versions of gitlint are likely to drop support for Python 2.6 and 3.3.
Full Changelog:
- New Rule:
ignore-by-title
allows users to ignore certain commits by matching a regex against a commit message title. (#54, #57). - New Rule:
ignore-by-body
allows users to ignore certain commits by matching a regex against a line in a commit message body. - Gitlint now supports pre-commit.com. Details in our documentation (#62).
- Gitlint now has a
--msg-filename
commandline flag that allows you to specify the commit message to lint via a file (#39). - Gitlint will now be silent by default when a specified commit range is empty (#46).
- Gitlint can now be installed on MacOS by brew via the homebrew-devops tap. To get the latest version of gitlint, always use pip for installation.
- If all goes well, gitlint will also be available as a package in the Ubuntu 18.04 repositories.
- Bugfixes:
The 0.9.0 release adds a new default author-valid-email
rule, important bugfixes and special case handling.
Special thanks to joshholl, ron8mcr,
omarkohl, domo141, nud
and AlexMooney for their contributions.
- New Rule:
author-valid-email
enforces a valid author email address. Details can be found in the Rules section of the documentation. - Breaking change: The
--commits
commandline flag now strictly follows the refspec format as interpreted by thegit rev-list <refspec>
command. This means that linting a single commit usinggitlint --commits <SHA>
won't work anymore. Instead, for single commits, users now need to specificygitlint --commits <SHA>^...<SHA>
. On the upside, this change also means that gitlint will now understand all refspec formatters, includinggitlint --commits HEAD
to lint all commits in the repository. This fixes #23. - Breaking change: Gitlint now always falls back on trying to read a git message from a local git repository, only reading a commit message from STDIN if one is passed. Before, gitlint only read from the local git repository when a TTY was present. This is likely the expected and desired behavior for anyone running gitlint in a CI environment. This fixes #40 and #42.
- Behavior Change: Gitlint will now by default ignore squash and fixup commits (fix for #33: fixup messages should not trigger a gitlint violation)
- Support for custom comment characters (#34)
- Support for
git commit --cleanup=scissors
(#34) - Bugfix: #37: Prevent Commas in text fields from breaking git log printing
- Debug output improvements
The 0.8.2 release brings minor improvements, bugfixes and some under-the-hood changes. Special thanks to tommyip for his contributions.
--extra-path
now also accepts a file path (in the past only directory paths where accepted). Thanks to tommyip for implementing this!- gitlint will now show more information when using the
--debug
flag. This is initial work and will continue to be improved upon in later releases. - Bugfixes:
- Development: better unit and integration test coverage for
--commits
The 0.8.1 release brings minor tweaks and some experimental features. Special thanks to tommyip for his contributions.
- Experimental: Linting a range of commits. Documentation. Known Caveats: #23, #24. Closes #14. Thanks to tommyip for implementing this!
- Experimental: Python 3.6 support
- Improved Windows error messaging: gitlint will now show a more descriptive error message when ran on windows. See #20 for details on the lack of Windows support.
The 0.8.0 release is a significant release that has been in the works for a long time. Special thanks to Claymore, gernd and ZhangYaxu for submitting bug reports and pull requests.
- Full unicode support: you can now lint messages in any language! This fixes #16 and #18.
- User-defined rules: you can now define your own custom rules if you want to extend gitlint's functionality.
- Pypy2 support!
- Debug output improvements: Gitlint will now print your active configuration when using
--debug
- The
general.target
option can now also be set via-c
flags or a.gitlint
file - Bugfixes:
- Various important fixes related to configuration precedence
- #17: Body MinLength is not working properly. Behavior Change: Gitlint now always applies this rule, even if the body has just a single line of content. Also, gitlint now counts the body-length for the entire body, not just the length of the first line.
- Various documentation improvements
- Development:
- Pylint compliance for all supported python versions
- Updated dependencies to latest versions
- Various
run_tests.sh
improvements for developer convenience
Bugfixes:
- Behavior Change: gitlint no longer prints the file path by default when using a
.gitlint
file. The path will still be printed when using the new--debug
flag. Special thanks to Slipcon for submitting this. - Gitlint now prints a correct violation message for the
title-match-regex
rule. Special thanks to Slipcon for submitting this. - Gitlint is now better at parsing commit messages cross-platform by taking platform specific line endings into account
- Minor documentation improvements
This release contains mostly bugfix and internal code improvements. Special thanks to William Turell and Joe Grund for bug reports and pull requests.
- commit-msg hooks improvements: The new commit-msg hook now allows you to edit your message if it contains violations, prints the commit message on aborting and is more compatible with GUI-based git clients such as SourceTree. You will need to uninstall and reinstall the commit-msg hook for these latest features.
- Python 2.6 support
- Behavior change: merge commits are now ignored by default. The rationale is that the original commits
should already be linted and that many merge commits don't pass gitlint checks by default
(e.g. exceeding title length or empty body is very common). This behavior can be overwritten by setting the
general option
ignore-merge-commit=false
. - Bugfixes and enhancements:
- #7: Hook compatibility with SourceTree
- #8: Illegal option -e
- #9: print full commit msg to stdout if aborted
- #11 merge commit titles exceeding the max title length by default
- Better error handling of invalid general options
- Development: internal refactoring to extract more info from git. This will allow for more complex rules in the future.
- Development: initial set of integration tests. Test gitlint end-to-end after it is installed.
- Development: pylint compliance for python 2.7
- Fix:
install-hook
andgenerate-config
commands not working when gitlint is installed from pypi.
- Python 3 (3.3+) support!
- All documentation is now hosted on http://jorisroovers.github.io/gitlint/
- New
generate-config
command generates a sample gitlint config file - New
--target
flag allows users to lint different directories than the current working directory - Breaking change: exit code behavior has changed. More details in the Exit codes section of the documentation.
- Breaking change:
--install-hook
and--uninstall-hook
have been renamed toinstall-hook
anduninstall-hook
respectively to better express that they are commands instead of options. - Better error handling when gitlint is executed in a directory that is not a git repository or when git is not installed.
- The git commit message hook now uses pretty colored output
- Fix:
--config
option no longer accepts directories as value - Development: unit tests are now ran using py.test
- New Rule:
title-match-regex
. Details can be found in the Rules section of the documentation. - Uninstall previously installed gitlint git commit hooks using:
gitlint --uninstall-hook
- Ignore rules on a per commit basis by adding e.g.:
gitlint-ignore: T1, body-hard-tab
to your git commit message. Usegitlint-ignore: all
to disable gitlint all together for a specific commit. body-is-missing
will now automatically be disabled for merge commits (use theignore-merge-commit: false
option to disable this behavior)- Violations are now sorted by line number first and then by rule id (previously the order of violations on the same line was arbitrary).
- Internal fix: added missing comma to setup.py which prevented pypi upload
- New rules:
body-is-missing
,body-min-length
,title-leading-whitespace
,body-changed-file-mention
. Details can be found in the Rules section of the documentation. - The git
commit-msg
hook now allows you to keep or discard the commit when it fails gitlint validation - gitlint is now also released as a python wheel on pypi.
- Internal: rule classes now have access to a gitcontext containing body the commit message and the files changed in the last commit.
title-must-not-contain-word
now has awords
option that can be used to specify which words should not occur in the title- gitlint violations are now printed to the stderr instead of stdout
- Various minor bugfixes
- gitlint now ignores commented out lines (i.e. starting with #) in your commit messages
- Experimental: git commit-msg hook support
- Under-the-hood: better test coverage :-)
- Rules can now have their behavior configured through options.
For example, the
title-max-length
rule now has aline-length
option. - Under-the-hood: The codebase now has a basic level of unit test coverage, increasing overall quality assurance
- Bugfix: added missing
sh
dependency
- Initial gitlint release
- Initial set of rules: title-max-length, title-trailing-whitespace, title-trailing-punctuation , title-hard-tab, title-must-not-contain-word, body-max-line-length, body-trailing-whitespace, body-hard-tab
- General gitlint configuration through a
gitlint
file - Silent and verbose mode
- Vagrantfile for easy development
- gitlint is available on pypi