; -*- mode: emacs-lisp; lexical-binding: t -*-
;; this and related files adapted from org-roam
;; explicitly set main file
(setf eldev-project-main-file "citar.el")

(eldev-use-package-archive 'gnu-elpa)
(eldev-use-package-archive 'melpa)

(eldev-use-plugin 'autoloads)

;; TODO what to do with these excluded files?
(setf eldev-standard-excludes `(:or ,eldev-standard-excludes "./test/manual/" "./citar-capf.el" "./citar-filenotify.el"))

;; (setf eldev-test-fileset '("./test/" "!./test/manual/"))
(eldev-add-extra-dependencies '(build test lint) 'embark 'auctex)

;; allow to load test helpers
;; (eldev-add-loading-roots 'test "test/utils")

;;; Linting settings

;; Tell checkdoc not to demand two spaces after a period.
(setq sentence-end-double-space nil)
(setq eldev-lint-default '(elisp))
(setq eldev-lint-stop-mode 'linter)

(with-eval-after-load 'elisp-lint
  ;; Used eldev lint package | checkdoc
  (setf elisp-lint-ignored-validators '("package-lint" "checkdoc")
        enable-local-variables :all)
  ;; Emacs 29 snapshot has new indentation convention for cl-letf
  (when (> emacs-major-version 28)
    (push "indent" elisp-lint-ignored-validators)))

;; Currently, package-lint has no other way of ignoring  checks.
;; See https://github.com/purcell/package-lint/issues/125
(advice-add #'package-lint--check-eval-after-load :override #'ignore)
