summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/checkdoc.el
diff options
context:
space:
mode:
authorStefan Kangas <stefan@marxist.se>2021-09-26 20:20:20 +0200
committerStefan Kangas <stefan@marxist.se>2021-09-26 20:23:59 +0200
commit77494628e2bf6edb8cdb3f78784aab880a6b87a2 (patch)
tree895c5f9adab0b19f139c2dd1459d0c268d83bb43 /lisp/emacs-lisp/checkdoc.el
parent950831c369636d8a681edc736a6c6151c1b1edee (diff)
downloademacs-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.el9
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