emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 7749462: checkdoc: Don't add "Commentary" header to test files


From: Stefan Kangas
Subject: master 7749462: checkdoc: Don't add "Commentary" header to test files
Date: Sun, 26 Sep 2021 14:24:12 -0400 (EDT)

branch: master
commit 77494628e2bf6edb8cdb3f78784aab880a6b87a2
Author: Stefan Kangas <stefan@marxist.se>
Commit: Stefan Kangas <stefan@marxist.se>

    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.
---
 lisp/emacs-lisp/checkdoc.el | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el
index 24e1ae3..b3707bb 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]