Skip to content

Commit 6246978

Browse files
Wild8illcarlescufi
authored andcommittedAug 16, 2021
gitlint: add gitlint config
Added a .gitlint config file, similar to the other nrf repos, that loads the custom gitlint rules from zephyr Signed-off-by: William Hamshaw <William.Hamshaw@nordicsemi.no>
1 parent aa5661d commit 6246978

File tree

2 files changed

+58
-0
lines changed

2 files changed

+58
-0
lines changed
 

‎.gitlint

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# All these sections are optional, edit this file as you like.
2+
[general]
3+
ignore=title-trailing-punctuation, T3, title-max-length, T1, body-hard-tab, B3, B1
4+
# verbosity should be a value between 1 and 3, the commandline -v flags take precedence over this
5+
verbosity = 3
6+
# By default gitlint will ignore merge commits. Set to 'false' to disable.
7+
ignore-merge-commits=true
8+
# Enable debug mode (prints more output). Disabled by default
9+
debug = false
10+
11+
# Set the extra-path where gitlint will search for user defined rules
12+
# See http://jorisroovers.github.io/gitlint/user_defined_rules for details
13+
extra-path=../zephyr/scripts/gitlint
14+
15+
[title-max-length-no-revert]
16+
line-length=75
17+
18+
[body-min-line-count]
19+
min-line-count=1
20+
21+
[body-max-line-count]
22+
max-line-count=200
23+
24+
[title-starts-with-subsystem]
25+
regex = ^(?!subsys:)(([^:]+):)(\s([^:]+):)*\s(.+)$
26+
27+
[title-must-not-contain-word]
28+
# Comma-separated list of words that should not occur in the title. Matching is case
29+
# insensitive. It's fine if the keyword occurs as part of a larger word (so "WIPING"
30+
# will not cause a violation, but "WIP: my title" will.
31+
words=wip
32+
33+
[title-match-regex]
34+
# python like regex (https://docs.python.org/2/library/re.html) that the
35+
# commit-msg title must be matched to.
36+
# Note that the regex can contradict with other rules if not used correctly
37+
# (e.g. title-must-not-contain-word).
38+
#regex=^US[0-9]*
39+
40+
[max-line-length-with-exceptions]
41+
# B1 = body-max-line-length
42+
line-length=72
43+
44+
[body-min-length]
45+
min-length=3
46+
47+
[body-is-missing]
48+
# Whether to ignore this rule on merge commits (which typically only have a title)
49+
# default = True
50+
ignore-merge-commits=false
51+
52+
[body-changed-file-mention]
53+
# List of files that need to be explicitly mentioned in the body when they are changed
54+
# This is useful for when developers often erroneously edit certain files or git submodules.
55+
# By specifying this rule, developers can only change the file when they explicitly reference
56+
# it in the commit message.
57+
#files=gitlint/rules.py,README.md

‎CODEOWNERS

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
/README.rst @ru-fu @carlescufi
1111
/.checkpatch.conf @carlescufi
1212
/.gitattributes @thst-nordic
13+
/.gitlint @thst-nordic
1314

1415
# All cmake related files
1516
/CMakeLists.txt @tejlmand

0 commit comments

Comments
 (0)
Please sign in to comment.