Skip to content

Commit 7468de5

Browse files
phlogistonjohnmergify[bot]
authored andcommitted
gitlint: add a .gitlint configuration file
Add a simple gitlint configuration file. Signed-off-by: John Mulligan <[email protected]>
1 parent d66ec68 commit 7468de5

File tree

2 files changed

+120
-1
lines changed

2 files changed

+120
-1
lines changed

.gitlint

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
# Edit this file as you like.
2+
#
3+
# All these sections are optional. Each section with the exception of [general] represents
4+
# one rule and each key in it is an option for that specific rule.
5+
#
6+
# Rules and sections can be referenced by their full name or by id. For example
7+
# section "[body-max-line-length]" could also be written as "[B1]". Full section names are
8+
# used in here for clarity.
9+
#
10+
[general]
11+
# Ignore certain rules, this example uses both full name and id
12+
# ignore=title-trailing-punctuation, T3
13+
14+
# verbosity should be a value between 1 and 3, the commandline -v flags take precedence over this
15+
verbosity=3
16+
17+
# By default gitlint will ignore merge, revert, fixup and squash commits.
18+
ignore-merge-commits=true
19+
# ignore-revert-commits=true
20+
# ignore-fixup-commits=true
21+
# ignore-squash-commits=true
22+
23+
# Ignore any data send to gitlint via stdin
24+
# ignore-stdin=true
25+
26+
# Fetch additional meta-data from the local repository when manually passing a
27+
# commit message to gitlint via stdin or --commit-msg. Disabled by default.
28+
# staged=true
29+
30+
# Enable debug mode (prints more output). Disabled by default.
31+
# debug=true
32+
33+
# Enable community contributed rules
34+
# See http://jorisroovers.github.io/gitlint/contrib_rules for details
35+
contrib=contrib-body-requires-signed-off-by
36+
37+
# Set the extra-path where gitlint will search for user defined rules
38+
# See http://jorisroovers.github.io/gitlint/user_defined_rules for details
39+
# extra-path=examples/
40+
41+
# This is an example of how to configure the "title-max-length" rule and
42+
# set the line-length it enforces to 80
43+
[title-max-length]
44+
line-length=72
45+
46+
# Conversely, you can also enforce minimal length of a title with the
47+
# "title-min-length" rule:
48+
# [title-min-length]
49+
# min-length=5
50+
51+
[title-must-not-contain-word]
52+
# Comma-separated list of words that should not occur in the title. Matching is case
53+
# insensitive. It's fine if the keyword occurs as part of a larger word (so "WIPING"
54+
# will not cause a violation, but "WIP: my title" will.
55+
words=wip,WIP
56+
57+
[title-match-regex]
58+
# python-style regex that the commit-msg title must match
59+
# Note that the regex can contradict with other rules if not used correctly
60+
# (e.g. title-must-not-contain-word).
61+
regex=^.{2,32}: .*
62+
63+
# [body-max-line-length]
64+
# line-length=72
65+
66+
# [body-min-length]
67+
# min-length=5
68+
69+
# [body-is-missing]
70+
# Whether to ignore this rule on merge commits (which typically only have a title)
71+
# default = True
72+
# ignore-merge-commits=false
73+
74+
# [body-changed-file-mention]
75+
# List of files that need to be explicitly mentioned in the body when they are changed
76+
# This is useful for when developers often erroneously edit certain files or git submodules.
77+
# By specifying this rule, developers can only change the file when they explicitly reference
78+
# it in the commit message.
79+
# files=gitlint/rules.py,README.md
80+
81+
# [body-match-regex]
82+
# python-style regex that the commit-msg body must match.
83+
# E.g. body must end in My-Commit-Tag: foo
84+
# regex=My-Commit-Tag: foo$
85+
86+
# [author-valid-email]
87+
# python-style regex that the commit author email address must match.
88+
# For example, use the following regex if you only want to allow email addresses from foo.com
89+
# regex=[^@][email protected]
90+
91+
# [ignore-by-title]
92+
# Ignore certain rules for commits of which the title matches a regex
93+
# E.g. Match commit titles that start with "Release"
94+
# regex=^Release(.*)
95+
96+
# Ignore certain rules, you can reference them by their id or by their full name
97+
# Use 'all' to ignore all rules
98+
# ignore=T1,body-min-length
99+
100+
# [ignore-by-body]
101+
# Ignore certain rules for commits of which the body has a line that matches a regex
102+
# E.g. Match bodies that have a line that that contain "release"
103+
# regex=(.*)release(.*)
104+
#
105+
# Ignore certain rules, you can reference them by their id or by their full name
106+
# Use 'all' to ignore all rules
107+
# ignore=T1,body-min-length
108+
109+
# [ignore-body-lines]
110+
# Ignore certain lines in a commit body that match a regex.
111+
# E.g. Ignore all lines that start with 'Co-Authored-By'
112+
# regex=^Co-Authored-By
113+
114+
# This is a contrib rule - a community contributed rule. These are disabled by default.
115+
# You need to explicitly enable them one-by-one by adding them to the "contrib" option
116+
# under [general] section above.
117+
# [contrib-title-conventional-commits]
118+
# Specify allowed commit types. For details see: https://www.conventionalcommits.org/
119+
# types = bugfix,user-story,epic

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,4 @@ commands =
6767
deps =
6868
gitlint==0.19.1
6969
commands =
70-
gitlint --commits origin/master.. lint
70+
gitlint -C .gitlint --commits origin/master.. lint

0 commit comments

Comments
 (0)