dev(ci): fix commit linter config for module scopes

This file used to live in /.github/ci.el. It was later moved to
/.doomrc (in 9b8ed39), but I forgot to push this change to update the
relative path to Doom's modules. This caused the linter to complain that
all module scopes were invalid.

Also, I removed the $DOOMDIR/modules/ check, as modules in the user's
config shouldn't be factored into the list of valid scopes.

Amend: 9b8ed397e8
This commit is contained in:
Henrik Lissner 2022-09-12 17:22:36 +02:00
parent 26914d0369
commit cf1c6e9a68
No known key found for this signature in database
GPG key ID: B60957CA074D39A3

13
.doomrc
View file

@ -35,16 +35,13 @@
doom-make-codeowners)))))
;;; Helpers
(cl-defun ci-check-module-scope (scope (&key type &allow-other-keys))
(defun ci-check-module-scope (scope _plist)
"Only allow :CATEGORY or MODULE scopes if they actually exist."
(seq-find (doom-rpartial
#'doom-glob (if (string-prefix-p ":" scope)
(format "%s" (substring scope 1))
(format "*/%s" scope)))
(list (doom-path (dir!) "../modules/")
(doom-path doom-user-dir "modules/"))))
(doom-glob (dir!) "modules" (if (string-prefix-p ":" scope)
(format "%s" (substring scope 1))
(format "*/%s" scope))))
(defun ci-check-docs-scope (scope _)
(defun ci-check-docs-scope (scope _plist)
"Allow any filename in docs/* as a scope for docs commits."
(member
scope (doom-files-in (doom-path (dir!) "../docs")