From 85812cd25d9e2f015bb71b26d51458b3718bf6c7 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Tue, 3 Nov 2020 07:07:48 +0100 Subject: Merging upstream version 0.14.0. Signed-off-by: Daniel Baumann --- docs/configuration.md | 296 ++++++++++++++++++++++++--------------------- docs/contrib_rules.md | 12 +- docs/contributing.md | 55 +++++---- docs/extra.js | 5 + docs/index.md | 176 +++++++++++++++++++-------- docs/rules.md | 244 +++++++++++++++++++++++++++++++------ docs/user_defined_rules.md | 264 +++++++++++++++++++++++++++------------- 7 files changed, 714 insertions(+), 338 deletions(-) create mode 100644 docs/extra.js (limited to 'docs') diff --git a/docs/configuration.md b/docs/configuration.md index 641b361..78224c1 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -1,21 +1,21 @@ # Configuration Gitlint can be configured through different means. -# Config files # -You can modify gitlint's behavior by adding a ```.gitlint``` file to your git repository. +## The .gitlint file +You can modify gitlint's behavior by adding a `.gitlint` file to your git repository. -Generate a default ```.gitlint``` config file by running: -```bash +Generate a default `.gitlint` config file by running: +```sh gitlint generate-config ``` You can also use a different config file like so: -```bash +```sh gitlint --config myconfigfile.ini ``` -The block below shows a sample ```.gitlint``` file. Details about rule config options can be found on the -[Rules](rules.md) page, details about the ```[general]``` section can be found in the +The block below shows a sample `.gitlint` file. Details about rule config options can be found on the +[Rules](rules.md) page, details about the `[general]` section can be found in the [General Configuration](configuration.md#general-configuration) section of this page. ```ini @@ -25,7 +25,7 @@ The block below shows a sample ```.gitlint``` file. Details about rule config op # one rule and each key in it is an option for that specific rule. # # Rules and sections can be referenced by their full name or by id. For example -# section "[body-max-line-length]" could be written as "[B1]". Full section names are +# section "[body-max-line-length]" could also be written as "[B1]". Full section names are # used in here for clarity. # Rule reference documentation: http://jorisroovers.github.io/gitlint/rules/ # @@ -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" @@ -99,10 +104,15 @@ ignore-merge-commits=false # it in the commit message. files=gitlint/rules.py,README.md +[body-match-regex] +# python-style regex that the commit-msg body must match. +# E.g. body must end in My-Commit-Tag: foo +regex=My-Commit-Tag: foo$ + [author-valid-email] # python like regex (https://docs.python.org/2/library/re.html) that the # commit author email address should be matched to -# For example, use the following regex if you only want to allow email addresses from foo.com +# E.g.: For example, use the following regex if you only want to allow email addresses from foo.com regex=[^@]+@foo.com [ignore-by-title] @@ -123,6 +133,11 @@ ignore=T1,body-min-length # Use 'all' to ignore all rules ignore=T1,body-min-length +[ignore-body-lines] +# Ignore certain lines in a commit body that match a regex. +# E.g. Ignore all lines that start with 'Co-Authored-By' +regex=^Co-Authored-By + # This is a contrib rule - a community contributed rule. These are disabled by default. # You need to explicitly enable them one-by-one by adding them to the "contrib" option # under [general] section above. @@ -131,20 +146,20 @@ ignore=T1,body-min-length types = bugfix,user-story,epic ``` -# Commandline config # +## Commandline config -You can also use one or more ```-c``` flags like so: +You can also use one or more `-c` flags like so: ``` $ gitlint -c general.verbosity=2 -c title-max-length.line-length=80 -c B1.line-length=100 ``` -The generic config flag format is ```-c .