GNU bug report logs -
#5126
23.1; checkdoc-comment-style-hooks stops at first error
Previous Next
Reported by: Kevin Ryde <user42 <at> zip.com.au>
Date: Fri, 4 Dec 2009 22:50:10 UTC
Severity: normal
Tags: notabug
Done: Andrew Hyatt <ahyatt <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
The bug report is saying that not all checks are run. If you trace your
functions you tested with and run checkdoc, you will find that foobaz is
checked for but not foobar. So not all checks are run. The author of the
bug wants both checked for.
Maybe this bug should be a feature request instead.
Or, maybe it's not a good idea to even do all the checks when only one
error message will be printed. I'm not sure why the author of the bug
thought this was a problem, to be honest.
If someone understands what the benefit would be of running
all checks, please share that info. Otherwise, I'm happy to close this
bug in a few weeks if we don't hear anything.
On Fri, Aug 16, 2019 at 3:14 PM Alex Branham <alex.branham <at> gmail.com> wrote:
> On Sat 09 Jul 2016 at 09:27, Andrew Hyatt <ahyatt <at> gmail.com> wrote:
>
> > This still is the case in Emacs 25. I agree that this seems like a
> > problem.
> >
> > Kevin Ryde <user42 <at> zip.com.au> writes:
> >
> >> checkdoc-comment-style-hooks is run by checkdoc-file-comments-engine
> >> with run-hook-with-args-until-success, which means if one of the hook
> >> functions returns an error string (as described in the hook's docstring)
> >> then no further functions are run.
>
> Maybe I'm misunderstanding this bug report, but this works for me:
>
> ;; foobar
> (defun my/checkdoc-comments-foobar ()
> "Check if foobar is in a comment."
> (save-excursion
> (goto-char (point-min))
> (unless (re-search-forward "^;; foobar" nil t)
> (checkdoc-create-error
> ";; foobar doesn't exist"
> (1- (point-max)) (point-max)))))
>
> (defun my/checkdoc-comments-foobaz ()
> "Check if foobaz is in a comment."
> (save-excursion
> (goto-char (point-min))
> (unless (re-search-forward "^;; foobaz" nil t)
> (checkdoc-create-error
> ";; foobaz doesn't exist"
> (1- (point-max)) (point-max)))))
>
> (add-hook 'checkdoc-comment-style-functions #'my/checkdoc-comments-foobar)
> (add-hook 'checkdoc-comment-style-functions #'my/checkdoc-comments-foobaz)
>
> Now checkdoc warns that foobaz is missing. You can change foobar to
> foobaz and it warns that foobar is missing. Can we close this bug report?
>
> Alex
>
[Message part 2 (text/html, inline)]
This bug report was last modified 5 years and 302 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.