From 55b85754d78f268907ad5fa5be886973bbef921d Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Fri, 10 Jul 2026 01:23:31 -0500 Subject: fix(flycheck): lint ledger buffers, which nothing ever did flycheck-ledger registers a ledger checker, but a checker only runs where flycheck-mode is on, and flycheck-mode was hooked to sh-mode and emacs-lisp-mode only. There's no global-flycheck-mode. So an unbalanced transaction in a financial file produced no warning at all, while the ledger module's commentary advertised linting. The hook goes in flycheck-config, not ledger-config, so that list stays the one answer to "where is flycheck turned on?". Verified on an unbalanced fixture: flycheck now reports "Transaction does not balance" with the $10.00 remainder, on the right line. I also accepted the whole-buffer sort the audit flagged. ledger-sort-startkey keys on the ISO date alone, and sort-subr is stable, so a save orders by date and leaves same-day transactions where they were typed. The audit note records both. --- modules/flycheck-config.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/flycheck-config.el b/modules/flycheck-config.el index 2a5a5e74..6ffe3ea2 100644 --- a/modules/flycheck-config.el +++ b/modules/flycheck-config.el @@ -44,7 +44,11 @@ :defer t :commands (flycheck-list-errors cj/flycheck-list-errors) - :hook ((sh-mode emacs-lisp-mode) . flycheck-mode) + ;; ledger-mode is here, not in ledger-config.el, so this list stays the one + ;; answer to "where is flycheck turned on?". flycheck-ledger registers a + ;; `ledger' checker but never enables the mode, so before this hook existed an + ;; unbalanced transaction in a ledger file produced no warning at all. + :hook ((sh-mode emacs-lisp-mode ledger-mode) . flycheck-mode) :bind (:map cj/custom-keymap ("?" . cj/flycheck-list-errors)) -- cgit v1.2.3