README.adoc in git-lint-4.6.0 vs README.adoc in git-lint-5.0.0

- old
+ new

@@ -405,16 +405,14 @@ ==== Commit Body Line Length [options="header"] |=== | Enabled | Severity | Defaults -| true | error | maximum: 72 +| false | error | maximum: 72 |=== -Ensures each line of the commit body doesn't force you to scroll horizontally to read the message. -This allows commit messages to remain readable and is especially handy when commit messages are read -via the command line or email clients. +Ensures each line of the commit body doesn't extend beyond the maximum column limit. ==== Commit Body Paragraph Capitalization [options="header"] |=== @@ -460,11 +458,11 @@ ==== Commit Body Presence [options="header"] |=== | Enabled | Severity | Defaults -| false | warn | minimum: 1 +| true | warn | minimum: 1 |=== Ensures a minimum number of lines are present within the commit body. Lines with empty characters (i.e. whitespace, carriage returns, etc.) are considered to be empty. @@ -515,10 +513,31 @@ Instead of using tracker shorthand syntax, take the time to write a short summary as to _why_ the commit was made. Doing this will make it easier to understand _why_ the commit was made, keeps the commit self-contained, and makes learning about/debugging the commit faster. +==== Commit Signature + +[options="header"] +|=== +| Enabled | Severity | Defaults +| false | error | includes: `["Good"]` +|=== + +Ensures all commit signatures are properly signed for improved security and validity of code being committed by various authors. By default, only "Good" signatures are allowed but you can expand this list if desired (although not recommended for security reasons). Valid options are: + +* *Bad* (_B_) +* *Error* (_E_) +* *Good* (_G_) +* *None* (_N_) +* *Revoked* (_R_) +* *Unknown* (_U_) +* *Expired* (_X_) +* *Expired Key* (_Y_) + +All of the above obtained when using the pretty formats as provided by link:https://git-scm.com/docs/git-log#Documentation/git-log.txt-emGem[Git Log]. + ==== Commit Subject Length [options="header"] |=== | Enabled | Severity | Defaults @@ -596,11 +615,11 @@ ==== Commit Trailer Collaborator Capitalization [options="header"] |=== | Enabled | Severity | Defaults -| false | error | none +| true | error | none |=== Ensures collaborator name is properly capitalized. Example: .... @@ -609,84 +628,264 @@ # Allowed Shepherd Derrial Book .... -==== Commit Trailer Collaborator Duplication +==== Commit Trailer Collaborator Email [options="header"] |=== | Enabled | Severity | Defaults -| false | error | none +| true | error | none |=== -Ensures collaborator trailers are not duplicated. Example: +Ensures collaborator email address is valid for commit trailer. .... # Disallowed +Co-Authored-By: River Tam <invalid> + +# Allowed +Co-Authored-By: River Tam <river@firefly.com> +.... + +==== Commit Trailer Collaborator Key + +[options="header"] +|=== +| Enabled | Severity | Defaults +| true | error | includes: `["Co-Authored-By"]` +|=== + +Ensures collaborator trailer key is correct format. + +.... +# Disallowed +Co-authored-by: River Tam <river@firefly.com> + +# Allowed +Co-Authored-By: River Tam <river@firefly.com> +.... + +==== Commit Trailer Collaborator Name + +[options="header"] +|=== +| Enabled | Severity | Defaults +| true | error | minimum: 2 +|=== + +Ensures collaborator name consists of, at least, a first and last name. Example: + +.... +# Disallowed +Co-Authored-By: River <river@firefly.com> + +# Allowed +Co-Authored-By: River Tam <river@firefly.com> +.... + +==== Commit Trailer Duplicate + +[options="header"] +|=== +| Enabled | Severity | Defaults +| true | error | minimum: 2 +|=== + +Ensures commit trailer keys are not duplicated. Example: + +.... +# Disallowed Co-Authored-By: Shepherd Derrial Book <shepherd@firefly.com> Co-Authored-By: Shepherd Derrial Book <shepherd@firefly.com> # Allowed Co-Authored-By: Malcolm Reynolds <malcolm@firefly.com> Co-Authored-By: Shepherd Derrial Book <shepherd@firefly.com> .... -==== Commit Trailer Collaborator Email +==== Commit Trailer Format Key [options="header"] |=== | Enabled | Severity | Defaults -| false | error | none +| true | error | includes: `["Format"]` |=== -Ensures collaborator email address is valid for commit trailer. +Ensures format trailer key is correct format. .... # Disallowed -Co-Authored-By: River Tam <invalid> +format: ASCII # Allowed -Co-Authored-By: River Tam <river@firefly.com> +Format: ASCII .... -==== Commit Trailer Collaborator Key +==== Commit Trailer Format Value [options="header"] |=== | Enabled | Severity | Defaults -| false | error | includes: `["Co-Authored-By"]` +| true | error | includes: `["ASCII", "Markdown"]` |=== -Ensures collaborator trailer key is correct format. +Ensures format trailer value is a valid value. .... # Disallowed -Co-authored-by: River Tam <river@firefly.com> +Format: Plain # Allowed -Co-Authored-By: River Tam <river@firefly.com> +Format: ASCII .... -==== Commit Trailer Collaborator Name +==== Commit Trailer Issue Key [options="header"] |=== | Enabled | Severity | Defaults -| false | error | minimum: 2 +| true | error | includes: `["Issue"]` |=== -Ensures collaborator name consists of, at least, a first and last name. Example: +Ensures issue trailer key is correct format. .... # Disallowed -Co-Authored-By: River <river@firefly.com> +issue: 123 # Allowed -Co-Authored-By: River Tam <river@firefly.com> +Issue: 123 .... +==== Commit Trailer Issue Value + +[options="header"] +|=== +| Enabled | Severity | Defaults +| true | error | includes: `["[\\w-]+"]` +|=== + +Ensures issue trailer value is correct format. + +.... +# Disallowed +Issue: 123+45 + +# Allowed +Issue: 123 +.... + +==== Commit Trailer Signer Capitalization + +[options="header"] +|=== +| Enabled | Severity | Defaults +| true | error | none +|=== + +Ensures commit signer trailer name is properly capitalized. + +.... +# Disallowed +Signed-By: jayne cobb + +# Allowed +Signed-By: Jayne Cobb +.... + +==== Commit Trailer Signer Email + +[options="header"] +|=== +| Enabled | Severity | Defaults +| true | error | none +|=== + +Ensures commit signer trailer email is properly capitalized. + +.... +# Disallowed +Signed-By: Jayne Cobb <invalid> + +# Allowed +Signed-By: Jayne Cobb <jcobb@firefly.com> +.... + +==== Commit Trailer Signer Key + +[options="header"] +|=== +| Enabled | Severity | Defaults +| true | error | includes: `["Signed-By"]` +|=== + +Ensures signer trailer key is correct format. + +.... +# Disallowed +signed-by: Jayne Cobb + +# Allowed +Signed-By: Jayne Cobb +.... + +==== Commit Trailer Signer Name + +[options="header"] +|=== +| Enabled | Severity | Defaults +| true | error | minimum: 2 +|=== + +Ensures signer name consists of, at least, a first and last name. + +.... +# Disallowed +Signed-By: Jayne + +# Allowed +Signed-By: Jayne Cobb +.... + +==== Commit Trailer Tracker Key + +[options="header"] +|=== +| Enabled | Severity | Defaults +| true | error | includes: `["Tracker"]` +|=== + +Ensures tracker trailer key is correct format. + +.... +# Disallowed +tracker: Linear + +# Allowed +Tracker: Linear +.... + +==== Commit Trailer Tracker Value + +[options="header"] +|=== +| Enabled | Severity | Defaults +| true | error | includes: `["[\\w\\-\\s]+"]` +|=== + +Ensures tracker trailer key is correct format. + +.... +# Disallowed +Tracker: *ACME$ + +# Allowed +Tracker: ACME Issues +.... + === Git ==== Default Branch Your default branch configuration is respected no matter if it is set globally or locally. If the @@ -786,21 +985,27 @@ Whenever a commit has been saved, this script will run Git Lint to check for issues. === Rake -This gem provides optional Rake tasks. They can be added to your project by adding the following -requirement to the top of your `Rakefile`: +You can add Rake support by adding the following to your `Rakefile`: [source,ruby] ---- -require "git/lint/rake/setup" +begin + require "git/lint/rake/register" +rescue LoadError => error + puts error.message +end + +Git::Lint::Rake::Register.call ---- -Now, when running `bundle exec rake -T`, you'll see `git_lint` included in the list. +Once required and registered, the following tasks will be available (i.e. `bundle exec rake -T`): -If you need a concrete example, check out the -link:https://github.com/bkuhlmann/git-lint/blob/main/Rakefile[Rakefile] of this project for details. +.... +rake git_lint +.... === Continuous Integration (CI) This gem automatically configures itself for known CI build servers (see below for details). If you have a build server that is not listed, please log an issue or provide an implementation with