diff options
author | Stefan Kangas <stefan@marxist.se> | 2021-09-26 20:20:20 +0200 |
---|---|---|
committer | Stefan Kangas <stefan@marxist.se> | 2021-09-26 20:23:59 +0200 |
commit | 77494628e2bf6edb8cdb3f78784aab880a6b87a2 (patch) | |
tree | 895c5f9adab0b19f139c2dd1459d0c268d83bb43 /lisp/emacs-lisp/checkdoc.el | |
parent | 950831c369636d8a681edc736a6c6151c1b1edee (diff) | |
download | emacs-77494628e2bf6edb8cdb3f78784aab880a6b87a2.tar.gz emacs-77494628e2bf6edb8cdb3f78784aab880a6b87a2.tar.bz2 emacs-77494628e2bf6edb8cdb3f78784aab880a6b87a2.zip |
checkdoc: Don't add "Commentary" header to test files
* lisp/emacs-lisp/checkdoc.el (checkdoc-file-comments-engine):
Don't add "Commentary:" header if it looks like a test file.
Diffstat (limited to 'lisp/emacs-lisp/checkdoc.el')
-rw-r--r-- | lisp/emacs-lisp/checkdoc.el | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el index 24e1ae3f097..b3707bb7863 100644 --- a/lisp/emacs-lisp/checkdoc.el +++ b/lisp/emacs-lisp/checkdoc.el @@ -2385,8 +2385,13 @@ Code:, and others referenced in the style guide." err (or ;; * Commentary Section - (if (not (lm-commentary-mark)) - (progn + (if (and (not (lm-commentary-mark)) + ;; No need for a commentary section in test files. + (not (string-match + (rx (or (seq (or "-test.el" "-tests.el") string-end) + "/test/" "/tests/")) + (buffer-file-name)))) + (progn (goto-char (point-min)) (cond ((re-search-forward |