tweak(ci): generalize commit linter defaults
So Doom can be used for general CI/CD (as part of doomemacs/ci). These
settings can be configured in .github/ci.el by default.
Ref: 0f6a653a13
This commit is contained in:
parent
0f6a653a13
commit
47d1b82382
1 changed files with 10 additions and 18 deletions
|
@ -55,24 +55,16 @@ Accapted value types can be one or more of ref, hash, url, username, or name.")
|
||||||
Accapted value types can be one or more of ref, hash, url, username, or name.")
|
Accapted value types can be one or more of ref, hash, url, username, or name.")
|
||||||
|
|
||||||
(defvar doom-cli-commit-types
|
(defvar doom-cli-commit-types
|
||||||
'(bump dev docs feat fix merge module nit perf refactor release revert test tweak)
|
'(bump dev docs feat fix merge nit perf refactor release revert test tweak)
|
||||||
"A list of valid commit types.")
|
"A list of valid commit types.")
|
||||||
|
|
||||||
(defvar doom-cli-commit-scopes
|
(defvar doom-cli-commit-scopeless-types '(bump merge release revert)
|
||||||
(list "cli"
|
"A list of commit types whose scopes should be passed in its BODY.
|
||||||
"ci"
|
|
||||||
"lib"
|
Don't: \"bump(SCOPE): ...\"
|
||||||
"docs"
|
Do: \"bump: SCOPE\"")
|
||||||
(fn! (scope (&key type))
|
|
||||||
(when (and (memq type '(bump merge module release revert))
|
(defvar doom-cli-commit-scopes '("ci")
|
||||||
scope)
|
|
||||||
(user-error "%s commits should never have a scope" type)))
|
|
||||||
(fn! (scope _)
|
|
||||||
(seq-find (doom-rpartial
|
|
||||||
#'doom-glob (if (string-prefix-p ":" scope)
|
|
||||||
(format "%s" (substring scope 1))
|
|
||||||
(format "*/%s" scope)))
|
|
||||||
doom-modules-dirs)))
|
|
||||||
"A list of valid commit scopes as strings or functions.
|
"A list of valid commit scopes as strings or functions.
|
||||||
|
|
||||||
Functions should take two arguments: a single scope (symbol) and a commit plist
|
Functions should take two arguments: a single scope (symbol) and a commit plist
|
||||||
|
@ -122,8 +114,8 @@ representing the current commit being checked against. See
|
||||||
|
|
||||||
(fn! (&key type scopes summary)
|
(fn! (&key type scopes summary)
|
||||||
"Complain about scoped types that are incompatible with scopes"
|
"Complain about scoped types that are incompatible with scopes"
|
||||||
(and (memq type '(bump revert merge module release))
|
(and scopes
|
||||||
scopes
|
(memq type doom-cli-commit-scopeless-types)
|
||||||
(fail! "Scopes for %s commits should go after the colon, not before"
|
(fail! "Scopes for %s commits should go after the colon, not before"
|
||||||
type)))
|
type)))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue