From e2d38cd54491535f409372393baeed787c77388d Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 13 Oct 2021 07:34:57 +0200 Subject: Merging upstream version 0.16.0. Signed-off-by: Daniel Baumann --- docs/configuration.md | 41 +++++++++++++++++++++++++++++++- docs/contributing.md | 4 +++- docs/images/readme-gitlint.png | Bin 0 -> 348007 bytes docs/index.md | 52 +++++++++++++++++++++++------------------ docs/rules.md | 31 ++++++++++++++++++++++++ 5 files changed, 103 insertions(+), 25 deletions(-) create mode 100644 docs/images/readme-gitlint.png (limited to 'docs') diff --git a/docs/configuration.md b/docs/configuration.md index 50c4e63..226ba8a 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -52,6 +52,12 @@ ignore-stdin=true # commit message to gitlint via stdin or --commit-msg. Disabled by default. staged=true +# Hard fail when the target commit range is empty. Note that gitlint will +# already fail by default on invalid commit ranges. This option is specifically +# to tell gitlint to fail on *valid but empty* commit ranges. +# Disabled by default. +fail-without-commits=true + # Enable debug mode (prints more output). Disabled by default. debug=true @@ -128,7 +134,7 @@ ignore=T1,body-min-length [ignore-by-body] # Ignore certain rules for commits of which the body has a line that matches a regex # E.g. Match bodies that have a line that that contain "release" -# regex=(.*)release(.*) +regex=(.*)release(.*) # # Ignore certain rules, you can reference them by their id or by their full name # Use 'all' to ignore all rules @@ -139,6 +145,15 @@ ignore=T1,body-min-length # E.g. Ignore all lines that start with 'Co-Authored-By' regex=^Co-Authored-By +[ignore-by-author-name] +# Ignore certain rules for commits of which the author name matches a regex +# E.g. Match commits made by dependabot +regex=(.*)dependabot(.*) + +# Ignore certain rules, you can reference them by their id or by their full name +# Use 'all' to ignore all rules +ignore=T1,body-min-length + # 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. @@ -363,6 +378,30 @@ GITLINT_STAGED=1 gitlint # using env variable staged=true ``` +### fail-without-commits + +Hard fail when the target commit range is empty. Note that gitlint will +already fail by default on invalid commit ranges. This option is specifically +to tell gitlint to fail on **valid but empty** commit ranges. + +Default value | gitlint version | commandline flag | environment variable +---------------|------------------|---------------------------|----------------------- + false | >= 0.15.2 | `--fail-without-commits` | `GITLINT_FAIL_WITHOUT_COMMITS` + +#### Examples +```sh +# CLI +# The following will cause gitlint to hard fail (i.e. exit code > 0) +# since HEAD..HEAD is a valid but empty commit range. +gitlint --fail-without-commits --commits HEAD..HEAD +GITLINT_FAIL_WITHOUT_COMMITS=1 gitlint # using env variable +``` +```ini +#.gitlint +[general] +fail-without-commits=true +``` + ### ignore-stdin Ignore any stdin data. Sometimes useful when running gitlint in a CI server. diff --git a/docs/contributing.md b/docs/contributing.md index e58378c..d39f9e1 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -44,7 +44,9 @@ vagrant ssh Or you can choose to use your local environment: ```sh -virtualenv .venv +python -m venv .venv +. .venv/bin/activate +pip install --upgrade pip pip install -r requirements.txt -r test-requirements.txt -r doc-requirements.txt python setup.py develop ``` diff --git a/docs/images/readme-gitlint.png b/docs/images/readme-gitlint.png new file mode 100644 index 0000000..516c915 Binary files /dev/null and b/docs/images/readme-gitlint.png differ diff --git a/docs/index.md b/docs/index.md index 5b371bf..98b72de 100644 --- a/docs/index.md +++ b/docs/index.md @@ -38,12 +38,11 @@ useful throughout the years. # Pip is recommended to install the latest version pip install gitlint -# macOS -brew install gitlint -sudo port install gitlint # alternative using macports - -# Ubuntu -apt-get install gitlint +# Community maintained packages: +brew install gitlint # Homebrew (macOS) +sudo port install gitlint # Macports (macOS) +apt-get install gitlint # Ubuntu +# Other package managers, see https://repology.org/project/gitlint/versions # Docker: https://hub.docker.com/r/jorisroovers/gitlint docker run --ulimit nofile=1024 -v $(pwd):/repo jorisroovers/gitlint @@ -134,8 +133,9 @@ Options: current working directory] -C, --config FILE Config file location [default: .gitlint] -c TEXT Config flags in format .