This file documents notable changes introduced in gitlint releases.
- Fix issue that prevented homebrew packages from being built (#460)
- Switch to using pypa/build in CI (#463) - thanks @webknjaz
This release was primarily focussed on modernizing gitlint's build and test tooling (details: #378).
- Python 3.6 no longer supported (EOL since 2021-12-23) (#379)
- This is the last release to support the sh library (used under-the-hood to execute git commands) by setting
GITLINT_USE_SH_LIB=1
. This is already disabled by default since v0.18.0.
- Allow for a single commit in the
--commits
cmd-line param (#412) - thanks carlescufi - Gitlint now separates
FILE_ENCODING
(always UTF-8) fromTERMINAL_ENCODING
(terminal dependent), this should improve issues with unicode. Usegitlint --debug
to inspect these values. (#424)
ignore-by-author-name
crashes without --staged (#445)- Various documentation fixes (#401, #433) - Thanks scop
- Adopted hatch for project management (#384). This significantly improves the developer workflow, please read the updated CONTRIBUTING page.
- Adopted ruff for linting, replacing pylint (#404)
- Gitlint now publishes dev builds on every commit to main (#429)
- Gitlint now publishes a
latest_dev
docker image on every commit to main (#451) (#452) - Dependencies updated
- Many improvements to the CI/CD worfklows
- Fixed coveralls integration: coveralls.io/github/jorisroovers/gitlint
- Improve unit test coverage (#453)
- Integration test fixes on windows (#392, #397)
- Devcontainer improvements (#428)
- Removal of Dockerfile.dev (#390)
- Fix most integration tests on Windows
- Fix Windows unit tests (#383)
- Introduce a gate/check GHA job (#375) - Thanks webknjaz
- Thanks to sigmavirus24 for continued overall help and support
Contributors: Special thanks to all contributors for this release - details inline!
- Python 3.11 support
- Last release to support Python 3.6 (EOL since 2021-12-23)
- Behavior Change: In a future release, gitlint will be switching to use
re.search
instead ofre.match
semantics for all rules. Your rule regexes might need updating as a result, gitlint will print a warning if so. More details are in the docs. (#254) - gitlint no longer uses the sh library by default in an attempt to reduce external dependencies. In case of issues, the use of
sh
can be re-enabled by setting the env varGITLINT_USE_SH_LIB=1
. This fallback will be removed entirely in a future gitlint release. (#351)
--commits
now also accepts a comma-separated list of commit hashes, making it possible to lint a list of non-contiguous commits without invoking gitlint multiple times (#283)- Improved handling of branches that have no commits (#188) - thanks domsekotill
- Support for
GITLINT_CONFIG
env variable (#189) - thanks Notgnoshi - Added a new
gitlint-ci
pre-commit hook, making it easier to run gitlint through pre-commit in CI (#191) - thanks guillaumelambert
- New contrib-disallow-cleanup-commits rule (#312) - thanks matthiasbeyer
- New contrib-allowed-authors rule (#358) - thanks stauchert
- Gitlint now recognizes
fixup=amend
commits (see related git documentation), available ascommit.is_fixup_amend_commit=True
- Gitlint now parses diff stat information, available in
commit.changed_files_stats
(#314)
- Use correct encoding when using
--msg-filename
parameter (#310) - Various documentation fixes (#244) (#263) (#266) (#294) (#295) (#347) (#364) - thanks scop, OrBin, jtaylor100, stauchert
- Dependencies updated
- Moved to black for formatting
- Fixed nasty CI issue (#298)
- Unit tests fix (#256) - thanks carlsmedstad
- Vagrant box removed in favor of github dev containers (#348)
- Removed a few lingering references to the
master
branch in favor ofmain
- Moved roadmap and project planning to github projects
- Thanks to sigmavirus24 for continued overall help and support
Contributors: Special thanks to all contributors for this release, in particular andersk and sigmavirus24.
- Gitlint is now split in 2 packages:
gitlint
andgitlint-core
. This allows users to install gitlint without pinned dependencies (which is the default) (#162) - Under-the-hood: dependencies updated
Contributors: Special thanks to all contributors for this release, in particular sigmavirus24, l0b0 and rafaelbubach.
- Python 3.10 support
- Heads-up: Python 3.6 will become EOL at the end of 2021. It's likely that future gitlint releases will stop supporting Python 3.6 as a result. We will continue to support Python 3.6 as long as it's easily doable, which in practice usually means as long as our dependencies support it.
--commit <ref>
flag to more easily lint a single commit message (#141)--fail-without-commits
flag will force gitlint to fail (exit code 253) when the target commit range is empty (typically when using--commits
) (#193)
- New Rule: ignore-by-author-name allows users to skip linting commit messages made by specific authors
- contrib-title-conventional-commits (CT1) now properly enforces the commit type (#185)
- contrib-title-conventional-commits (CT1) now supports the BREAKING CHANGE symbol "!" (#186)
- Dependencies updated
- Test and github action improvements
Contributors: Special thanks to all contributors for this release, in particular PW999, gsemet and Lorac.
- Git commit message body with only new lines is not longer considered empty by
body-is-missing
(#176) - Added compatibility with
git commit -s
forcontrib-requires-signed-off-by
rule (#178) - Minor tweak to gitlint commit-hook output (#173)
- All dependencies have been upgraded to the latest available versions (
Click==7.1.2
,arrow==1.0.3
,sh==1.14.1
). - Minor doc fixes
Contributors: Special thanks to BrunIF, lukech, Cielquan, harens and sigmavirus24.
- This release drops support for Python 2.7 and Python 3.5 (both are EOL). Other than a few minor fixes, there are no functional differences from the 0.14.0 release.
- Mac users: Gitlint can now be installed using both homebrew (upgraded to latest) and macports. Special thanks to @harens for maintaining these packages (best-effort).
- Gitlint now properly handles exceptions when using its built-in commit-msg hook (#166).
- All dependencies have been upgraded to the latest available versions (
Click==7.1.2
,arrow==0.17.0
,sh==1.14.1
). - Much under-the-hood refactoring as a result of dropping Python 2.7
Contributors: Special thanks to all contributors for this release, in particular mrshu, glasserc, strk, chgl, melg8 and sigmavirus24.
- IMPORTANT: Gitlint 0.14.x will be the last gitlint release to support Python 2.7 and Python 3.5, as both are EOL which makes it difficult to keep supporting them.
- Python 3.9 support
- Named Rules allow users to have multiple instances of the same rule active at the same time. This is useful when you want to enforce the same rule multiple times but with different options (#113, #66)
- User-defined Configuration Rules allow users to dynamically change gitlint's configuration and/or the commit before any other rules are applied.
- The
commit-msg
hook has been re-written in Python (it contained a lot of Bash before), fixing a number of platform specific issues. Existing users will need to reinstall their hooks (gitlint uninstall-hook; gitlint install-hook
) to make use of this. - Most general options can now be set through environment variables (e.g. set the
general.ignore
option viaGITLINT_IGNORE=T1,T2
). The list of available environment variables can be found in the configuration documentation. - Users can now use
self.log.debug("my message")
for debugging purposes in their user-defined rules. Debug messages will show up when runninggitlint --debug
. - Breaking: User-defined rule id's can no longer start with 'I', as those are reserved for built-in gitlint ignore rules.
- New
RegexOption
rule option type for use in user-defined rules. By using theRegexOption
, regular expressions are pre-validated at gitlint startup and compiled only once which is much more efficient when linting multiple commits.
- New Rule: title-min-length enforces a minimum length on titles (default: 5 chars) (#138)
- New Rule: body-match-regex allows users to enforce that the commit-msg body matches a given regex (#130)
- New Rule: ignore-body-lines allows users to ignore parts of a commit by matching a regex against the lines in a commit message body (#126)
- Added 'ci' and 'build' to conventional commit types (#135)
- Improved UTF-8 fallback on Windows (ongoing - #96)
- Windows users can now use the 'edit' function of the
commit-msg
hook (#94) - Doc update: Users should use
--ulimit nofile=1024
when invoking gitlint using Docker (#129) - The
commit-msg
hook was broken in Ubuntu's gitlint package due to a python/python3 mismatch (#127) - Better error message when no git username is set (#149)
- Options can now actually be set to
None
(from code) to make them optional. - Ignore rules no longer have
"None"
as default regex, but an empty regex - effectively disabling them by default (as intended).
- Minor performance improvements (removed some unnecessary regex matching),
- Test improvements,
- Improved debug logging,
- CI runs on pull requests
- PR request template
- Patch to enable
--staged
flag for pre-commit. - Minor doc updates (#109)
- Python 3.8 support
- Python 3.4 no longer supported. Python 3.4 has reached EOL and an increasing of gitlint's dependencies have dropped support which makes it hard to maintain.
- Improved Windows support: better unicode handling. Issues remain but the basic functionality works.
- Behavior Change: Revert Commits are now recognized and ignored by default (#99)
--staged
flag: gitlint can now detect meta-data (such as author details, changed files, etc) of staged/pre-commits. Useful when you use gitlint's commit-msg hook or precommit (#105)- New branch properties on
GitCommit
andGitContext
, useful when writing your own user-defined rules:commit.branches
andcommit.context.current_branch
(#108)
- Gitlint no longer crashes when acting on empty repositories (this only occurred in specific circumstances).
- Changed files are now better detected in repos that only have a root commit
- Improved performance and memory (gitlint now caches git properties)
- Improved
--debug
output - Improved documentation
- Dependencies updated
- Unit and integration test improvements
- Migrated from TravisCI to Github Actions.
Contributors: Special thanks to all contributors for this release, in particular @rogalksi and @byrney.
- Python 3.3 no longer supported. Python 3.4 is likely to follow in a future release as it has reached EOL as well.
- PyPy 3.5 support
- Contrib Rules: community-contributed rules that are disabled
by default, but can be enabled through configuration. Contrib rules are meant to augment default gitlint behavior by
providing users with rules for common use-cases without forcing these rules on all gitlint users.
- New Contrib Rule:
contrib-title-conventional-commits
enforces the Conventional Commits spec. Details in our documentation. - New Contrib Rule:
cc1-contrib-requires-signed-off-by
ensures that all commit messages contain aSign-Off-By
line. Details in our documentation. - If you're interested in adding new Contrib rules to gitlint, please start by reading the Contributing page. Thanks for considering!
- New Contrib Rule:
- Experimental (!) Windows support: Basic functionality is working, but there are still caveats. For more details, please refer to #20 and the open issues related to Windows.
- Support for
--ignore-stdin
command-line flag to ignore any text send via stdin. (#56, #89)
- Dependencies updated
- Experimental Dockerfile
- Github issue template.
- Python 3.7 support
- Python 2.6 no longer supported
- Various dependency updates and under the hood fixes (see #76 for details).
Special thanks to @pbregener for his contributions related to python 3.7 support and test fixes.
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.
- 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.
- 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.
- We fixed a nasty and recurring issue with running gitlint in CI. Hopefully that's the end of it :-) (#40).
- Fix for custom git comment characters (#48).
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.
- 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 <ref>
won't work anymore. Instead, for single commits, users now need to specificygitlint --commits <ref>^...<ref>
. 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)
- New Rule:
author-valid-email
enforces a valid author email address. Details can be found in the Rules section of the documentation.
- 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.
- #24: --commits doesn't take commit specific config into account
- #27: --commits returns the wrong exit code
- 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: 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.
- Experimental: Linting a range of commits. Documentation. Known Caveats: #23, #24. Closes #14. Thanks to tommyip for implementing this!
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.
- Pypy2 support!
- Various documentation improvements
- User-defined rules: you can now define your own custom rules if you want to extend gitlint's functionality.
- 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
- 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.
- Pylint compliance for all supported python versions
- Updated dependencies to latest versions
- Various
run_tests.sh
improvements for developer convenience
- 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.
- 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
.
- 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.
- #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
- internal refactoring to extract more info from git. This will allow for more complex rules in the future.
- initial set of integration tests. Test gitlint end-to-end after it is installed.
- pylint compliance for python 2.7
install-hook
andgenerate-config
commands not working when gitlint is installed from pypi.
- Python 3 (3.3+) support!
- All documentation is now hosted on https://jorisroovers.github.io/gitlint/
- 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.
- New
generate-config
command generates a sample gitlint config file - New
--target
flag allows users to lint different directories than the current working directory - 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
--config
option no longer accepts directories as value
- Unit tests are now ran using py.test
- 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).
- New Rule:
title-match-regex
. Details can be found in the Rules section of the documentation.
- Added missing comma to setup.py which prevented pypi upload
- gitlint is now also released as a python wheel on pypi.
- The git
commit-msg
hook now allows you to keep or discard the commit when it fails gitlint validation
- 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.
- Internal: rule classes now have access to a gitcontext containing body the commit message and the files changed in the last commit.
- gitlint violations are now printed to the stderr instead of stdout
- gitlint now ignores commented out lines (i.e. starting with #) in your commit messages
- Experimental: git commit-msg hook support
title-must-not-contain-word
now has awords
option that can be used to specify which words should not occur in the title
- Various minor bugfixes
- 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.
- The codebase now has a basic level of unit test coverage, increasing overall quality assurance
- 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