Skip to content

Commit 2fc9e67

Browse files
committed
Documentation updates
- Changed links to point to the main branch instead of master where required - Various minor doc tweaks - Updated CHANGELOG for upcoming 0.14.0 release
1 parent d542b14 commit 2fc9e67

14 files changed

+174
-150
lines changed

CHANGELOG.md

+29-16
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,36 @@
11
# Changelog #
22

3-
## v0.14.0 (TBD) ##
4-
- **IMPORTANT:** Gitlint 0.14.x will be the last gitlint release to support Python 2.7 and Python 3.5, as [both are EOL](https://endoflife.date/python) which makes them hard to keep supporting.
5-
- [Named Rules](TODO) 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.
6-
- [User-defined Configuration Rules](TODO) allow users to dynamically change gitlint's configuration and/or the commit *before* any other rules are applied.
3+
## v0.14.0 (2020-10-24) ##
4+
5+
Contributors:
6+
Special thanks to all contributors for this release, in particular [@mrshu](https://github.com/mrshu), [@glasserc](https://github.com/glasserc), [@strk](https://github.com/strk), [@chgl](https://github.com/chgl), [@melg8](https://github.com/melg8) and [@sigmavirus24](https://github.com/sigmavirus24).
7+
8+
9+
- **IMPORTANT: Gitlint 0.14.x will be the last gitlint release to support Python 2.7 and Python 3.5, as [both are EOL](https://endoflife.date/python) which makes it difficult to keep supporting them.**
710
- Python 3.9 support
8-
- Most general options can now be set through environment variables (e.g. set the `general.ignore` option via `GITLINT_IGNORE=T1,T2`). The list of available environment variables can be found in the [configuration documentation](TODO).
9-
- Users can now use `self.log.debug("my message")` for debugging purposes in their user-defined rules
10-
- Breaking: User-defined rule id's can no longer start with 'I', as those are reserved for built-in gitlint ignore rules.
11-
- **New Rule**: [title-min-length](TODO) enforces a minimum length on titles (default: 5 chars) ([#130](https://github.com/jorisroovers/gitlint/issues/138))
12-
- **New Rule**: [ignore-body-lines](TODO) allows users to
13-
[ignore parts of a commit](http://jorisroovers.github.io/gitlint/#ignoring-commits) by matching a regex against
14-
the lines in a commit message body. ([#126](https://github.com/jorisroovers/gitlint/issues/126)).
15-
- **New Rule**: [body-match-regex](TODO) allows users to enforce that the commit-msg body matches a given regex ([#130](https://github.com/jorisroovers/gitlint/issues/126))
11+
- **New Rule**: [title-min-length](http://jorisroovers.github.io/gitlint/rules/#t8-title-min-length) enforces a minimum length on titles (default: 5 chars) ([#138](https://github.com/jorisroovers/gitlint/issues/138))
12+
- **New Rule**: [body-match-regex](http://jorisroovers.github.io/gitlint/rules/#b8-body-match-regex) allows users to enforce that the commit-msg body matches a given regex ([#130](https://github.com/jorisroovers/gitlint/issues/130))
13+
- **New Rule**: [ignore-body-lines](http://jorisroovers.github.io/gitlint/rules/#i3-ignore-body-lines) allows users to
14+
[ignore parts of a commit](http://jorisroovers.github.io/gitlint/gitlint/#ignoring-commits) by matching a regex against
15+
the lines in a commit message body ([#126](https://github.com/jorisroovers/gitlint/issues/126))
16+
- [Named Rules](http://jorisroovers.github.io/gitlint/#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](https://github.com/jorisroovers/gitlint/issues/130), [#66](https://github.com/jorisroovers/gitlint/issues/130))
17+
- [User-defined Configuration Rules](http://jorisroovers.github.io/gitlint/user_defined_rules/#configuration-rules) allow users to dynamically change gitlint's configuration and/or the commit *before* any other rules are applied.
18+
- 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.
19+
- Most general options can now be set through environment variables (e.g. set the `general.ignore` option via `GITLINT_IGNORE=T1,T2`). The list of available environment variables can be found in the [configuration documentation](http://jorisroovers.github.io/gitlint/configuration).
20+
- Users can now use `self.log.debug("my message")` for debugging purposes in their user-defined rules. Debug messages will show up when running `gitlint --debug`.
21+
- **Breaking**: User-defined rule id's can no longer start with 'I', as those are reserved for [built-in gitlint ignore rules](http://jorisroovers.github.io/gitlint/rules/#i1-ignore-by-title).
22+
- New `RegexOption` rule [option type for use in user-defined rules](http://jorisroovers.github.io/gitlint/user_defined_rules/#options). By using the `RegexOption`, regular expressions are pre-validated at gitlint startup and compiled only once which is much more efficient when linting multiple commits.
1623
- Bugfixes:
17-
- Options can now actually be set to `None` (from code) to make them optional.
18-
- Ignore rules no longer have "None" as default regex, but an empty regex - effectively disabling them by default (as intended).
19-
- New `RegexOption` rule option type for use in user-defined rules. By using the `RegexOption`, regular expressions are pre-validated at gitlint startup and compiled only once which is much more efficient compared when linting multiple commits.
20-
- Minor performance improvement: Removed some unneccessary regex matching
24+
- Improved UTF-8 fallback on Windows (ongoing - [#96](https://github.com/jorisroovers/gitlint/issues/96))
25+
- Windows users can now use the 'edit' function of the `commit-msg` hook ([#94](https://github.com/jorisroovers/gitlint/issues/94))
26+
- Doc update: Users should use `--ulimit nofile=1024` when invoking gitlint using Docker ([#129](https://github.com/jorisroovers/gitlint/issues/129))
27+
- The `commit-msg` hook was broken in Ubuntu's gitlint package due to a python/python3 mismatch ([#127](https://github.com/jorisroovers/gitlint/issues/127))
28+
- Better error message when no git username is set ([#149](https://github.com/jorisroovers/gitlint/issues/149))
29+
- Options can now actually be set to `None` (from code) to make them optional.
30+
- Ignore rules no longer have `"None"` as default regex, but an empty regex - effectively disabling them by default (as intended).
31+
- Contrib Rules:
32+
- Added 'ci' and 'build' to conventional commit types ([#135](https://github.com/jorisroovers/gitlint/issues/135))
33+
- Under-the-hood: minor performance improvements (removed some unnecessary regex matching), test improvements, improved debug logging, CI runs on pull requests, PR request template.
2134

2235
## v0.13.1 (2020-02-26)
2336

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Git commit message linter written in python (for Linux and Mac, experimental on
1313
## Contributing ##
1414
All contributions are welcome and very much appreciated!
1515

16-
**I'm looking for contributors that are interested in taking a more active co-maintainer role as it's becoming increasingly difficult for me to find time to maintain gitlint. Please open a PR if you're interested - Thanks!**
16+
**I'm [looking for contributors](https://github.com/jorisroovers/gitlint/issues/134) that are interested in taking a more active co-maintainer role as it's becoming increasingly difficult for me to find time to maintain gitlint. Please open a PR if you're interested - Thanks!**
1717

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

docs/configuration.md

+88-87
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ The block below shows a sample `.gitlint` file. Details about rule config option
2525
# one rule and each key in it is an option for that specific rule.
2626
#
2727
# Rules and sections can be referenced by their full name or by id. For example
28-
# section "[body-max-line-length]" could be written as "[B1]". Full section names are
28+
# section "[body-max-line-length]" could also be written as "[B1]". Full section names are
2929
# used in here for clarity.
3030
# Rule reference documentation: http://jorisroovers.github.io/gitlint/rules/
3131
#
@@ -70,8 +70,8 @@ line-length=80
7070

7171
# Conversely, you can also enforce minimal length of a title with the
7272
# "title-min-length" rule:
73-
# [title-min-length]
74-
# min-length=5
73+
[title-min-length]
74+
min-length=5
7575

7676
[title-must-not-contain-word]
7777
# Comma-separated list of words that should not occur in the title. Matching is case
@@ -112,7 +112,7 @@ regex=My-Commit-Tag: foo$
112112
[author-valid-email]
113113
# python like regex (https://docs.python.org/2/library/re.html) that the
114114
# commit author email address should be matched to
115-
# For example, use the following regex if you only want to allow email addresses from foo.com
115+
# E.g.: For example, use the following regex if you only want to allow email addresses from foo.com
116116
117117

118118
[ignore-by-title]
@@ -237,82 +237,6 @@ GITLINT_VERBOSITY=2 gitlint # using env variable
237237
verbosity=2
238238
```
239239

240-
### ignore-merge-commits
241-
242-
Whether or not to ignore merge commits.
243-
244-
Default value | gitlint version | commandline flag | environment variable
245-
---------------|------------------|-------------------|-----------------------
246-
true | >= 0.7.0 | Not Available | Not Available
247-
248-
#### Examples
249-
```sh
250-
# CLI
251-
gitlint -c general.ignore-merge-commits=false
252-
```
253-
```ini
254-
#.gitlint
255-
[general]
256-
ignore-merge-commits=false
257-
```
258-
259-
### ignore-revert-commits
260-
261-
Whether or not to ignore revert commits.
262-
263-
Default value | gitlint version | commandline flag | environment variable
264-
---------------|------------------|-------------------|-----------------------
265-
true | >= 0.13.0 | Not Available | Not Available
266-
267-
#### Examples
268-
```sh
269-
# CLI
270-
gitlint -c general.ignore-revert-commits=false
271-
```
272-
```ini
273-
#.gitlint
274-
[general]
275-
ignore-revert-commits=false
276-
```
277-
278-
### ignore-fixup-commits
279-
280-
Whether or not to ignore [fixup](https://git-scm.com/docs/git-commit#git-commit---fixupltcommitgt) commits.
281-
282-
Default value | gitlint version | commandline flag | environment variable
283-
---------------|------------------|-------------------|-----------------------
284-
true | >= 0.9.0 | Not Available | Not Available
285-
286-
#### Examples
287-
```sh
288-
# CLI
289-
gitlint -c general.ignore-fixup-commits=false
290-
```
291-
```ini
292-
#.gitlint
293-
[general]
294-
ignore-fixup-commits=false
295-
```
296-
297-
### ignore-squash-commits
298-
299-
Whether or not to ignore [squash](https://git-scm.com/docs/git-commit#git-commit---squashltcommitgt) commits.
300-
301-
Default value | gitlint version | commandline flag | environment variable
302-
---------------|------------------|-------------------|-----------------------
303-
true | >= 0.9.0 | Not Available | Not Available
304-
305-
#### Examples
306-
```sh
307-
# CLI
308-
gitlint -c general.ignore-squash-commits=false
309-
```
310-
```ini
311-
#.gitlint
312-
[general]
313-
ignore-squash-commits=false
314-
```
315-
316240
### ignore
317241

318242
Comma separated list of rules to ignore (by name or id).
@@ -414,6 +338,28 @@ GITLINT_CONTRIB=contrib-title-conventional-commits,CC1 gitlint # using env v
414338
[general]
415339
contrib=contrib-title-conventional-commits,CC1
416340
```
341+
342+
### staged
343+
344+
Fetch additional meta-data from the local `repository when manually passing a commit message to gitlint via stdin or `--commit-msg`.
345+
346+
Default value | gitlint version | commandline flag | environment variable
347+
---------------|------------------|-------------------|-----------------------
348+
false | >= 0.13.0 | `--staged` | `GITLINT_STAGED`
349+
350+
#### Examples
351+
```sh
352+
# CLI
353+
gitlint --staged
354+
gitlint -c general.staged=true # different way of doing the same
355+
GITLINT_STAGED=1 gitlint # using env variable
356+
```
357+
```ini
358+
#.gitlint
359+
[general]
360+
staged=true
361+
```
362+
417363
### ignore-stdin
418364

419365
Ignore any stdin data. Sometimes useful when running gitlint in a CI server.
@@ -435,23 +381,78 @@ GITLINT_IGNORE_STDIN=1 gitlint # using env variable
435381
ignore-stdin=true
436382
```
437383

438-
### staged
384+
### ignore-merge-commits
439385

440-
Fetch additional meta-data from the local `repository when manually passing a commit message to gitlint via stdin or `--commit-msg`.
386+
Whether or not to ignore merge commits.
387+
388+
Default value | gitlint version | commandline flag | environment variable
389+
---------------|------------------|-------------------|-----------------------
390+
true | >= 0.7.0 | Not Available | Not Available
391+
392+
#### Examples
393+
```sh
394+
# CLI
395+
gitlint -c general.ignore-merge-commits=false
396+
```
397+
```ini
398+
#.gitlint
399+
[general]
400+
ignore-merge-commits=false
401+
```
402+
403+
### ignore-revert-commits
404+
405+
Whether or not to ignore revert commits.
441406

442407
Default value | gitlint version | commandline flag | environment variable
443408
---------------|------------------|-------------------|-----------------------
444-
false | >= 0.13.0 | `--staged` | `GITLINT_STAGED`
409+
true | >= 0.13.0 | Not Available | Not Available
445410

446411
#### Examples
447412
```sh
448413
# CLI
449-
gitlint --staged
450-
gitlint -c general.staged=true # different way of doing the same
451-
GITLINT_STAGED=1 gitlint # using env variable
414+
gitlint -c general.ignore-revert-commits=false
452415
```
453416
```ini
454417
#.gitlint
455418
[general]
456-
staged=true
419+
ignore-revert-commits=false
457420
```
421+
422+
### ignore-fixup-commits
423+
424+
Whether or not to ignore [fixup](https://git-scm.com/docs/git-commit#git-commit---fixupltcommitgt) commits.
425+
426+
Default value | gitlint version | commandline flag | environment variable
427+
---------------|------------------|-------------------|-----------------------
428+
true | >= 0.9.0 | Not Available | Not Available
429+
430+
#### Examples
431+
```sh
432+
# CLI
433+
gitlint -c general.ignore-fixup-commits=false
434+
```
435+
```ini
436+
#.gitlint
437+
[general]
438+
ignore-fixup-commits=false
439+
```
440+
441+
### ignore-squash-commits
442+
443+
Whether or not to ignore [squash](https://git-scm.com/docs/git-commit#git-commit---squashltcommitgt) commits.
444+
445+
Default value | gitlint version | commandline flag | environment variable
446+
---------------|------------------|-------------------|-----------------------
447+
true | >= 0.9.0 | Not Available | Not Available
448+
449+
#### Examples
450+
```sh
451+
# CLI
452+
gitlint -c general.ignore-squash-commits=false
453+
```
454+
```ini
455+
#.gitlint
456+
[general]
457+
ignore-squash-commits=false
458+
```

docs/contributing.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ that's open to a lot of change and input.
1313

1414
When contributing code, please consider all the parts that are typically required:
1515

16-
- [Unit tests](https://github.com/jorisroovers/gitlint/tree/master/gitlint/tests) (automatically
16+
- [Unit tests](https://github.com/jorisroovers/gitlint/tree/main/gitlint/tests) (automatically
1717
[enforced by CI](https://github.com/jorisroovers/gitlint/actions)). Please consider writing
1818
new ones for your functionality, not only updating existing ones to make the build pass.
19-
- [Integration tests](https://github.com/jorisroovers/gitlint/tree/master/qa) (also automatically
19+
- [Integration tests](https://github.com/jorisroovers/gitlint/tree/main/qa) (also automatically
2020
[enforced by CI](https://github.com/jorisroovers/gitlint/actions)). Again, please consider writing new ones
2121
for your functionality, not only updating existing ones to make the build pass.
22-
- [Documentation](https://github.com/jorisroovers/gitlint/tree/master/docs)
22+
- [Documentation](https://github.com/jorisroovers/gitlint/tree/main/docs)
2323

2424
Since we want to maintain a high standard of quality, all of these things will have to be done regardless before code
2525
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
@@ -63,12 +63,12 @@ To run tests:
6363
./run_tests.sh --all # Run unit, integration, pep8 and gitlint checks
6464
```
6565

66-
The `Vagrantfile` comes with `virtualenv`s for python 2.7, 3.5, 3.6, 3.7 and pypy2.
66+
The `Vagrantfile` comes with `virtualenv`s for python 2.7, 3.5, 3.6, 3.7, 3.8, 3.9 and pypy2.
6767
You can easily run tests against specific python environments by using the following commands *inside* of the Vagrant VM:
6868
```sh
6969
./run_tests.sh --envs 27 # Run the unit tests against Python 2.7
70-
./run_tests.sh --envs 27,35,pypy2 # Run the unit tests against Python 2.7, Python 3.5 and Pypy2
71-
./run_tests.sh --envs 27,35 --pep8 # Run pep8 checks against Python 2.7 and Python 3.5 (also works for --git, --integration, --pep8, --stats and --lint.
70+
./run_tests.sh --envs 27,37,pypy2 # Run the unit tests against Python 2.7, Python 3.7 and Pypy2
71+
./run_tests.sh --envs 27,37 --pep8 # Run pep8 checks against Python 2.7 and Python 3.7 (also works for --git, --integration, --pep8, --stats and --lint.
7272
./run_tests.sh --envs all --all # Run all tests against all environments
7373
./run_tests.sh --all-env --all # Idem: Run all tests against all environments
7474
```
@@ -115,9 +115,9 @@ Then, we suggest taking the following approach to add a Contrib rule:
115115

116116
1. **Write your rule as a [user-defined rule](../user_defined_rules)**. In terms of code, Contrib rules are identical to
117117
user-defined rules, they just happen to have their code sit within the gitlint codebase itself.
118-
2. **Add your user-defined rule to gitlint**. You should put your file(s) in the [gitlint/contrib/rules](https://github.com/jorisroovers/gitlint/tree/master/gitlint/contrib/rules) directory.
119-
3. **Write unit tests**. The gitlint codebase contains [Contrib rule test files you can copy and modify](https://github.com/jorisroovers/gitlint/tree/master/gitlint/tests/contrib/rules).
120-
4. **Write documentation**. In particular, you should update the [gitlint/docs/contrib_rules.md](https://github.com/jorisroovers/gitlint/blob/master/docs/contrib_rules.md) file with details on your Contrib rule.
118+
2. **Add your user-defined rule to gitlint**. You should put your file(s) in the [gitlint/contrib/rules](https://github.com/jorisroovers/gitlint/tree/main/gitlint/contrib/rules) directory.
119+
3. **Write unit tests**. The gitlint codebase contains [Contrib rule test files you can copy and modify](https://github.com/jorisroovers/gitlint/tree/main/gitlint/tests/contrib/rules).
120+
4. **Write documentation**. In particular, you should update the [gitlint/docs/contrib_rules.md](https://github.com/jorisroovers/gitlint/blob/main/docs/contrib_rules.md) file with details on your Contrib rule.
121121
5. **Create a Pull Request**: code review typically requires a bit of back and forth. Thanks for your contribution!
122122

123123

docs/index.md

+6-8
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ future versions of gitlint might fix this and not require the `--pretty` argumen
247247

248248
_Introduced in gitlint v0.9.0 (experimental in v0.8.0)_
249249

250-
Gitlint allows users to commit a number of commits at once like so:
250+
Gitlint allows users to lint a number of commits at once like so:
251251

252252
```sh
253253
# Lint a specific commit range:
@@ -261,10 +261,8 @@ gitlint --commits "019cf40^...019cf40"
261261
The `--commits` flag takes a **single** refspec argument or commit range. Basically, any range that is understood
262262
by [git rev-list](https://git-scm.com/docs/git-rev-list) as a single argument will work.
263263

264-
Prior to v0.8.1 gitlint didn't support this feature. However, older versions of gitlint can still lint a range or set
265-
of commits at once by creating a simple bash script that pipes the commit messages one by one into gitlint. This
266-
approach can still be used with newer versions of gitlint in case `--commits` doesn't provide the flexibility you
267-
are looking for.
264+
For cases where the `--commits` option doesn't provide the flexibility you need, you can always use a simple shell
265+
script to lint an arbitrary set of commits, like shown in the example below.
268266

269267
```sh
270268
#!/bin/sh
@@ -403,15 +401,15 @@ $ gitlint
403401

404402
Named rules are further treated identical to all other rules in gitlint:
405403

406-
- you can reference by their full name, when e.g. adding them to your `ignore` configuration
404+
- You can reference them by their full name, when e.g. adding them to your `ignore` configuration
407405
```ini
408406
# .gitlint file example
409407
[general]
410408
ignore=T5:more-words,title-must-not-contain-word:extra-words
411409
```
412410

413-
- you can use them to instantiate multiple of the same [user-defined rule](user_defined_rules.md)
414-
- you can configure them using [any of the ways you can configure regular gitlint rules](configuration.md)
411+
- You can use them to instantiate multiple of the same [user-defined rule](user_defined_rules.md)
412+
- You can configure them using [any of the ways you can configure regular gitlint rules](configuration.md)
415413

416414

417415
## Exit codes

0 commit comments

Comments
 (0)