From 98274f25587047e2e3c140426067362d67932d66 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Thu, 5 May 2022 15:15:37 +0200 Subject: [PATCH] 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: 4bae9ffa4769 --- .github/ci.el | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/ci.el b/.github/ci.el index d8ba11bf2..ce92f90cc 100644 --- a/.github/ci.el +++ b/.github/ci.el @@ -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