dev(ci): update commit linter config

To adapt to efforts made in 00e0733 to generalize its API.

Also fixes a 'Keyword argument :X not one of (:type)' error.

Ref: 4bae9ffa47
This commit is contained in:
Henrik Lissner 2022-05-05 15:15:37 +02:00
parent f281971206
commit 98274f2558
No known key found for this signature in database
GPG key ID: B60957CA074D39A3

19
.github/ci.el vendored
View file

@ -11,12 +11,14 @@
(add-to-list 'doom-cli-commit-scopes "cli")
(add-to-list 'doom-cli-commit-scopes "lib")
(add-to-list 'doom-cli-commit-scopes "docs")
(add-to-list 'doom-cli-commit-scopes #'ci-module-scope)
(add-to-list 'doom-cli-commit-scopes #'ci-docs-scope)
(add-to-list 'doom-cli-commit-scopes '(docs "install" ci-check-docs-scope))
(add-to-list 'doom-cli-commit-scopes #'ci-check-module-scope)
;; DEPRECATED Will be removed once modules live in their own repo
(add-to-list 'doom-cli-commit-scopes '(release "modules"))
;;; Helpers
(cl-defun ci-module-scope (scope (&key type))
(cl-defun ci-check-module-scope (scope (&key type &allow-other-keys))
"Only allow :CATEGORY or MODULE scopes if they actually exist."
(seq-find (doom-rpartial
#'doom-glob (if (string-prefix-p ":" scope)
@ -25,12 +27,11 @@
(list (doom-dir (dir!) "../modules/")
(doom-dir doom-private-dir "modules/"))))
(cl-defun ci-docs-scope (scope (&key type))
(defun ci-check-docs-scope (scope _)
"Allow any filename in docs/* as a scope for docs commits."
(when (eq type 'docs)
(member scope
(cons "install"
(mapcar #'file-name-base
(doom-glob (dir!) "../docs/*.org"))))))
(member
scope (doom-files-in (doom-path (dir!) "../docs")
:match "\\.org$"
:map #'file-name-base)))
;;; ci.el ends here