summaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorMarek Ć uppa <mrshu@users.noreply.github.com>2020-10-18 11:47:40 +0200
committerGitHub <noreply@github.com>2020-10-18 11:47:40 +0200
commitd542b14cb5b2ee591d074230fe8df4f1b6c326d5 (patch)
treed5cdb6fec2efdfb963627d1555f0cc0ac7f65863 /docs
parent2ce3103cb7c118042d95b6e89c9ddd42362a9592 (diff)
New Rule: title-min-length (#140)
The title-min-length rule enforces a minimum length on commit titles. This closes #138
Diffstat (limited to 'docs')
-rw-r--r--docs/configuration.md7
-rw-r--r--docs/rules.md25
2 files changed, 30 insertions, 2 deletions
diff --git a/docs/configuration.md b/docs/configuration.md
index 7b8fa8a..9f298b9 100644
--- a/docs/configuration.md
+++ b/docs/configuration.md
@@ -68,6 +68,11 @@ extra-path=examples/
[title-max-length]
line-length=80
+# Conversely, you can also enforce minimal length of a title with the
+# "title-min-length" rule:
+# [title-min-length]
+# min-length=5
+
[title-must-not-contain-word]
# Comma-separated list of words that should not occur in the title. Matching is case
# insensitive. It's fine if the keyword occurs as part of a larger word (so "WIPING"
@@ -449,4 +454,4 @@ GITLINT_STAGED=1 gitlint # using env variable
#.gitlint
[general]
staged=true
-``` \ No newline at end of file
+```
diff --git a/docs/rules.md b/docs/rules.md
index 427c844..97bc012 100644
--- a/docs/rules.md
+++ b/docs/rules.md
@@ -14,6 +14,7 @@ T4 | title-hard-tab | >= 0.1.0 | Title cannot contain h
T5 | title-must-not-contain-word | >= 0.1.0 | Title cannot contain certain words (default: "WIP")
T6 | title-leading-whitespace | >= 0.4.0 | Title cannot have leading whitespace (space or tab)
T7 | title-match-regex | >= 0.5.0 | Title must match a given regex (default: None)
+T8 | title-max-length | >= 0.14.0 | Title length must be &gt; 5 chars.
B1 | body-max-line-length | >= 0.1.0 | Lines in the body must be &lt; 80 chars
B2 | body-trailing-whitespace | >= 0.1.0 | Body cannot have trailing whitespace (space or tab)
B3 | body-hard-tab | >= 0.1.0 | Body cannot contain hard tab characters (\t)
@@ -126,6 +127,28 @@ regex | >= 0.5 | .* | [Python regex](https://docs.python.
regex=^US[1-9][0-9]*
```
+## T8: title-min-length ##
+
+ID | Name | gitlint version | Description
+------|-----------------------------|-----------------|-------------------------------------------
+T1 | title-min-length | >= | Title length must be &gt; 5 chars.
+
+
+### Options
+
+Name | gitlint version | Default | Description
+---------------|-----------------|---------|----------------------------------
+min-length | >= 0.14.0 | 5 | Minimum required title length
+
+### Examples
+
+#### .gitlint
+
+```ini
+# Titles should be min 3 chars
+[title-min-length]
+min-length=3
+```
## B1: body-max-line-length
@@ -378,4 +401,4 @@ regex=(^Co-Authored-By)|(^Signed-Off-By)
# Ignore lines that contain 'foobar'
[ignore-body-lines]
regex=(.*)foobar(.*)
-``` \ No newline at end of file
+```