Skip to content

Commit 033978d

Browse files
Updating documentation prior to 0.9.0 release
Also updated .travis.yml file to run integration tests for certain environments. These tests still fail intermittently on travis. Hopefully enabling them will give us more insight into when and why.
1 parent 4b02587 commit 033978d

File tree

8 files changed

+96
-27
lines changed

8 files changed

+96
-27
lines changed

.travis.yml

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,51 @@ matrix:
99
os: linux
1010
- python: "3.3"
1111
os: linux
12+
script:
13+
# Skip integration tests in Travis for Python 3.3, need to look into this
14+
# Error example: https://travis-ci.org/jorisroovers/gitlint/jobs/310861373
15+
- "./run_tests.sh"
16+
- "./run_tests.sh --build"
17+
- "./run_tests.sh --pep8"
18+
- "./run_tests.sh --lint"
19+
- "./run_tests.sh --git"
1220
- python: "3.4"
1321
os: linux
22+
script:
23+
# Skip integration tests in Travis for Python 3.4, need to look into this
24+
# Error example: https://travis-ci.org/jorisroovers/gitlint/jobs/310861374
25+
- "./run_tests.sh"
26+
- "./run_tests.sh --build"
27+
- "./run_tests.sh --pep8"
28+
- "./run_tests.sh --lint"
29+
- "./run_tests.sh --git"
1430
- python: "3.5"
1531
os: linux
16-
# Skip lint tests for python 3.6 (see https://github.com/PyCQA/pylint/issues/1072)
32+
script:
33+
# Skip integration tests in Travis for Python 3.5, need to look into this
34+
# Error example: https://travis-ci.org/jorisroovers/gitlint/jobs/310861375
35+
- "./run_tests.sh"
36+
- "./run_tests.sh --build"
37+
- "./run_tests.sh --pep8"
38+
- "./run_tests.sh --lint"
39+
- "./run_tests.sh --git"
1740
- python: "3.6"
1841
os: linux
1942
script:
20-
- "./run_tests.sh"
21-
- "./run_tests.sh --build"
22-
- "./run_tests.sh --pep8"
23-
- "./run_tests.sh --git"
43+
# Skip lint tests for python 3.6 (see https://github.com/PyCQA/pylint/issues/1072)
44+
- "./run_tests.sh"
45+
- "./run_tests.sh --integration"
46+
- "./run_tests.sh --build"
47+
- "./run_tests.sh --pep8"
48+
- "./run_tests.sh --git"
2449
- python: "pypy"
2550
os: linux
26-
- python: "2.7"
27-
os: osx
28-
script: "pip --version"
2951
install:
3052
- "pip install -r requirements.txt"
3153
- "pip install -r test-requirements.txt"
3254
script:
3355
- "./run_tests.sh"
56+
- "./run_tests.sh --integration"
3457
- "./run_tests.sh --build"
3558
- "./run_tests.sh --pep8"
3659
- "./run_tests.sh --lint"

CHANGELOG.md

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,38 @@
11
# Changelog #
22

3-
## v0.9.0 (In Progress) ##
3+
## v0.9.0 (2017-12-03) ##
4+
The 0.9.0 release adds a new default ```author-valid-email``` rule, important bugfixes and special case handling.
5+
Special thanks to [joshholl](https://github.com/joshholl), [ron8mcr](https://github.com/ron8mcr),
6+
[omarkohl](https://github.com/omarkohl), [domo141](https://github.com/domo141), [nud](https://github.com/nud)
7+
and [AlexMooney](https://github.com/AlexMooney) for their contributions.
48

59
- New Rule: ```author-valid-email``` enforces a valid author email address. Details can be found in the
6-
[Rules section of the documentation](http://jorisroovers.github.io/gitlint/rules/).
10+
[Rules section of the documentation](http://jorisroovers.github.io/gitlint/rules/#m1-author-valid-email).
711
- **Breaking change**: The ```--commits``` commandline flag now strictly follows the refspec format as interpreted
812
by the [```git rev-list <refspec>```](https://git-scm.com/docs/git-rev-list) command. This means
913
that linting a single commit using ```gitlint --commits <SHA>``` won't work anymore. Instead, for single commits,
1014
users now need to specificy ```gitlint --commits <SHA>^...<SHA>```. On the upside, this change also means
1115
that gitlint will now understand all refspec formatters, including ```gitlint --commits HEAD``` to lint all commits
12-
in the repository.
16+
in the repository. This fixes [#23](https://github.com/jorisroovers/gitlint/issues/40).
17+
- **Breaking change**: Gitlint now always falls back on trying to read a git message from a local git repository, only
18+
reading a commit message from STDIN if one is passed. Before, gitlint only read from the local git repository when
19+
a TTY was present. This is likely the expected and desired behavior for anyone running gitlint in a CI environment.
20+
This fixes [#40](https://github.com/jorisroovers/gitlint/issues/40) and
21+
[#42](https://github.com/jorisroovers/gitlint/issues/42).
22+
- **Behavior Change**: Gitlint will now by default
23+
[ignore squash and fixup commits](http://jorisroovers.github.io/gitlint/#merge-fixup-and-squash-commits)
24+
(fix for [#33: fixup messages should not trigger a gitlint violation](https://github.com/jorisroovers/gitlint/issues/33))
25+
- Support for custom comment characters ([#34](https://github.com/jorisroovers/gitlint/issues/34))
26+
- Support for [```git commit --cleanup=scissors```](https://git-scm.com/docs/git-commit#git-commit---cleanupltmodegt)
27+
([#34](https://github.com/jorisroovers/gitlint/issues/34))
28+
- Bugfix: [#37: Prevent Commas in text fields from breaking git log printing](https://github.com/jorisroovers/gitlint/issues/37)
1329
- Debug output improvements
1430

1531
## v0.8.2 (2017-04-25) ##
1632

17-
The 0.8.2 release brings minor improvements, bugfixes and some under-the-hood changes. Special thanks to
33+
The 0.8.2 release brings minor improvements, bugfixes and some under-the-hood changes. Special thanks to
1834
[tommyip](https://github.com/tommyip) for his contributions.
35+
1936
- ```--extra-path``` now also accepts a file path (in the past only directory paths where accepted).
2037
Thanks to [tommyip](https://github.com/tommyip) for implementing this!
2138
- gitlint will now show more information when using the ```--debug``` flag. This is initial work and will continue to

CONTRIBUTING.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Contributing
2+
3+
Thanks for your interest in contributing to gitlint!
4+
5+
Instructions on how to get started can be found on [http://jorisroovers.github.io/gitlint/contributing](http://jorisroovers.github.io/gitlint/contributing/).
6+

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77

88
Git commit message linter written in python, checks your commit messages for style.
99

10-
**See [jorisroovers.github.io/gitlint/](http://jorisroovers.github.io/gitlint/) for full documentation.**
10+
**See [jorisroovers.github.io/gitlint](http://jorisroovers.github.io/gitlint/) for full documentation.**
1111

1212
<a href="http://jorisroovers.github.io/gitlint/" target="_blank"><img src="https://asciinema.org/a/30477.png" width="640"/></a>
1313

1414
## Contributing ##
1515
All contributions are welcome and very much appreciated!
1616

1717
See [jorisroovers.github.io/gitlint/contributing](http://jorisroovers.github.io/gitlint/contributing) for details on
18-
how to get started - it's easy!
18+
how to get started - it's easy!
1919

2020
FYI, we maintain a [wishlist on our wiki](https://github.com/jorisroovers/gitlint/wiki/Wishlist).

docs/contributing.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,24 @@
1-
We'd love for you to [contribute to gitlint](https://github.com/jorisroovers/gitlint).
2-
Just create an issue or open a pull request. Sometimes it takes a while for me to get back to you
3-
(this is a hobby project), but rest assured that we read your message and appreciate your interest!
1+
We'd love for you to contribute to gitlint. Thanks for your interest!
2+
Sometimes it takes a while for [me](https://github.com/jorisroovers) to
3+
get back to you (this is a hobby project), but rest assured that we read your message and appreciate your interest!
44
We maintain a [wishlist on our wiki](https://github.com/jorisroovers/gitlint/wiki/Wishlist),
55
but we're obviously open to any suggestions!
66

7+
# Guidelines
8+
9+
When contributing code, please consider all the parts that are typically required:
10+
11+
- [Unit tests](https://github.com/jorisroovers/gitlint/tree/master/gitlint/tests) (automatically
12+
[enforced by Travis](https://travis-ci.org/jorisroovers/gitlint)). Please consider writing
13+
new ones for your functionality, not only updating existing ones to make the build pass.
14+
- [Integration tests](https://github.com/jorisroovers/gitlint/tree/master/qa) (also automatically
15+
[enforced by Travis](https://travis-ci.org/jorisroovers/gitlint)). Again, please consider writing new ones
16+
for your functionality, not only updating existing ones to make the build pass.
17+
- [Documentation](https://github.com/jorisroovers/gitlint/tree/master/docs)
18+
19+
Since we want to maintain a high standard of quality, all of these things will have to be done regardless before code
20+
can make it as part of a release. If you can already include them as part of your PR, it's a huge timesaver for us
21+
and it's likely that your PR will be merged and released a lot sooner. Thanks!
722
# Development #
823

924
There is a Vagrantfile in this repository that can be used for development.

docs/index.md

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# Intro #
22
Gitlint is a git commit message linter written in python: it checks your commit messages for style.
33

4-
Great for use as a ```commit-msg``` git hook or as part of your gating script in a CI/CD pipeline (e.g. jenkins).
4+
Great for use as a [commit-msg git hook](#using-gitlint-as-a-commit-msg-hook) or as part of your gating script in a
5+
[CI pipeline (e.g. Jenkins)](index.md#using-gitlint-in-a-ci-environment).
56

67
<script type="text/javascript" src="https://asciinema.org/a/30477.js" id="asciicast-30477" async></script>
78

@@ -13,7 +14,7 @@ Great for use as a ```commit-msg``` git hook or as part of your gating script in
1314
## Features ##
1415
- **Commit message hook**: [Auto-trigger validations against new commit message right when you're committing](#using-gitlint-as-a-commit-msg-hook).
1516
- **Easily integrated**: Gitlint will validate any git commit message you give it via standard input.
16-
Perfect for [integration with your own scripts or CI system](#using-gitlint-in-a-cicd-script).
17+
Perfect for [integration with your own scripts or CI system](#using-gitlint-in-a-ci-environment).
1718
- **Sane defaults:** Many of gitlint's validations are based on
1819
[well-known](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html),
1920
[community](http://addamhardy.com/blog/2013/06/05/good-commit-messages-and-enforcing-them-with-git-hooks/),
@@ -82,6 +83,7 @@ The default verbosity is ```-vvv```.
8283
Other commands and variations:
8384

8485
```no-highlight
86+
$ gitlint --help
8587
Usage: gitlint [OPTIONS] COMMAND [ARGS]...
8688
8789
Git lint tool, checks your git commit messages for styling issues
@@ -133,24 +135,30 @@ gitlint uninstall-hook
133135
file in your local repository, gitlint will refuse to install the ```commit-msg``` hook. Gitlint will also only
134136
uninstall unmodified commit-msg hooks that were installed by gitlint.
135137

136-
## Using gitlint in a CI/CD script ##
138+
## Using gitlint in a CI environment ##
137139
By default, when just running ```gitlint``` without additional parameters, gitlint lint the last commit in the current
138140
git repository.
139141

140-
This makes it easy to add gitlint to a check script that is run in a CI environment. In fact, this is exactly what we
141-
do ourselves: on every commit,
142+
This makes it easy to add gitlint to a check script that is run in a CI environment (Jenkins, TravisCI, pre-commit,
143+
CircleCI, etc).
144+
In fact, this is exactly what we do ourselves: on every commit,
142145
[we run gitlint as part of our travisCI tests](https://github.com/jorisroovers/gitlint/blob/v0.7.1/run_tests.sh#L62-L65).
143146
This will cause the build to fail when we submit a bad commit message.
144147

145-
Gitlint will also lint any commit message that you feed it via stdin like so:
148+
149+
!!! note
150+
Versions prior to gitlint 0.9.0 required a TTY to be attached to STDIN for this to work, this is no longer required
151+
now.
152+
153+
Alternatively, gitlint will also lint any commit message that you feed it via stdin like so:
146154
```bash
147155
# lint the last commit message
148156
git log -1 --pretty=%B | gitlint
149157
# lint a specific commit: 62c0519
150158
git log -1 --pretty=%B 62c0519 | gitlint
151159
```
152-
For now, it's required that you specify ```--pretty=%B``` (=only print the log message, not the metadata),
153-
future versions of gitlint might fix this.
160+
Note that gitlint requires that you specify ```--pretty=%B``` (=only print the log message, not the metadata),
161+
future versions of gitlint might fix this and not require the ```--pretty``` argument.
154162

155163
## Linting a range of commits ##
156164
_Experimental support introduced in gitlint v0.8.1, known issues:_

docs/rules.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ M1 | author-valid-email | >= 0.8.3 | Author email address mus
176176

177177
Name | gitlint version | Default | Description
178178
----------------------|-------------------|------------------------------|----------------------------------
179-
regex | >= 0.8.3 | ```[^@ ]+@[^@ ]+\.[^@ ]+``` | Regex the commit author email address is matched against
179+
regex | >= 0.9.0 | ```[^@ ]+@[^@ ]+\.[^@ ]+``` | Regex the commit author email address is matched against
180180

181181

182182
!!! note

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
description = "Git commit message linter written in python, checks your commit messages for style."
1515
long_description = """
16-
Great for use as a commit-msg git hook or as part of your gating script in a CI/CD pipeline (e.g. jenkins).
16+
Great for use as a commit-msg git hook or as part of your gating script in a CI pipeline (e.g. jenkins).
1717
Many of the gitlint validations are based on `well-known`_ community_ `standards`_, others are based on checks that
1818
we've found useful throughout the years. Gitlint has sane defaults, but you can also easily customize it to your
1919
own liking.

0 commit comments

Comments
 (0)