- Deprecates the doom-private-dir variable in favor of doom-user-dir. - Renames the pseudo category for the user's module: :private -> :user. - Renames the doom-private-error error type to doom-user-error. Emacs uses the term "user" to refer to the "things" in user space (e.g. user-init-file, user-emacs-directory, user-mail-address, xdg-user-dirs, package-user-dir, etc), and I'd like to be consistent with that. It also has the nice side-effect of being slightly shorter. I also hope 'doom-user-error' will be less obtuse to beginners than 'doom-private-error'.
54 lines
2.3 KiB
Text
54 lines
2.3 KiB
Text
;;; .doomrc --- doom runtime config -*- mode: emacs-lisp; lexical-binding: t; -*-
|
|
;;; Commentary:
|
|
;;; Code:
|
|
(require 'doom) ; be silent, byte-compiler
|
|
|
|
(after! doom-cli-ci
|
|
;;; Commit linter types
|
|
(add-to-list 'doom-ci-commit-types 'module)
|
|
(add-to-list 'doom-ci-commit-scopeless-types 'module)
|
|
|
|
;;; Commit linter scopes
|
|
(add-to-list 'doom-ci-commit-scopes "cli")
|
|
(add-to-list 'doom-ci-commit-scopes "lib")
|
|
(add-to-list 'doom-ci-commit-scopes "docs")
|
|
(add-to-list 'doom-ci-commit-scopes '(docs "install" ci-check-docs-scope))
|
|
(add-to-list 'doom-ci-commit-scopes #'ci-check-module-scope)
|
|
;; DEPRECATED Will be removed once modules live in their own repo
|
|
(add-to-list 'doom-ci-commit-scopes '(release "modules")))
|
|
|
|
(after! doom-cli-make
|
|
;;; Codeowners
|
|
(dolist (path (cdr (doom-module-load-path (list doom-modules-dir))))
|
|
;; I will be the default owner for everything in the repo unless a later
|
|
;; match takes precedence.
|
|
(add-to-list 'doom-make-codeowners "# The default owner(s) unless another takes precedence")
|
|
(add-to-list 'doom-make-codeowners '("*" . "@doomemacs/maintainers"))
|
|
;; Module maintainers (see https://git.doomemacs.org/teams)
|
|
(save-match-data
|
|
(add-to-list 'doom-make-codeowners "# Module maintainers")
|
|
(when (string-match "/modules/\\([^/]+\\)/\\([^/]+\\)/$" path)
|
|
(push (cons (substring (match-string 0 path) 1)
|
|
(format "@doomemacs/%s-%s"
|
|
(match-string 1 path)
|
|
(match-string 2 path)))
|
|
doom-make-codeowners)))))
|
|
|
|
;;; Helpers
|
|
(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)
|
|
(format "%s" (substring scope 1))
|
|
(format "*/%s" scope)))
|
|
(list (doom-dir (dir!) "../modules/")
|
|
(doom-dir doom-user-dir "modules/"))))
|
|
|
|
(defun ci-check-docs-scope (scope _)
|
|
"Allow any filename in docs/* as a scope for docs commits."
|
|
(member
|
|
scope (doom-files-in (doom-path (dir!) "../docs")
|
|
:match "\\.org$"
|
|
:map #'file-name-base)))
|
|
|
|
;;; .doomrc ends here
|