This package adds occurrences of TODO
and other keywords as messages of flycheck. The keywords are configured in hl-todo
hl-todo-flycheck-setup
should be called after all the other checkers has been registered. The checker hl-todo
is registered as next checker of every other checker found in flycheck-checkers
. This way, hl-todo
checker will be invoked after the installed checker for the current major mode, and the results will be merged in flycheck error list.
hl-todo
checker can be disabled as any other checker, with M-x
flycheck-disable-checker
.
For convenience, the buffer local variable flycheck-hl-todo-enabled
can be use to activate or deactivate this checker.
This package is available on Melpa.
The following is an example of installation using straight and use-package. flycheck and hl-todo should be installed as dependencies.
(use-package hl-todo
:ensure t)
(use-package flycheck
:ensure t
(global-flycheck-mode 1))
(use-package flycheck-hl-todo
:ensure t
:defer 5 ; Need to be initialized after the rest of checkers
:straight (:host github :repo "alvarogonzalezsotillo/flycheck-hl-todo")
:config
(flycheck-hl-todo-setup))
hl-todo
and flycheck-hl-todo
can be activated independently. If you prefer to enable flycheck-hl-todo
only when hl-todo-mode
is enabled, you can use the following code:
(defun flycheck-hl-todo-follow-mode ()
(setq flycheck-hl-todo-enabled hl-todo-mode)
;; Force flycheck update
(flycheck-buffer))
(add-hook 'hl-todo-mode-hook #'flycheck-hl-todo-follow-mode)
flycheck-hl-todo-extra-modes
: The checker will be enabled on every mode where other checker is already registered. Use this variable to define a list of modes where this checker will be also avaliable, although there is no previous checker for them.flycheck-hl-todo-not-chained-checkers
: List of checkers that will not have this checker as next checker.hl-todo-keyword-faces
: This variable belongs tohl-todo
package. It contains the keywords to be added as flycheck messages.