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