]> git.eshelyaron.com Git - emacs.git/commitdiff
checkdoc: Don't add "Commentary" header to test files
authorStefan Kangas <stefan@marxist.se>
Sun, 26 Sep 2021 18:20:20 +0000 (20:20 +0200)
committerStefan Kangas <stefan@marxist.se>
Sun, 26 Sep 2021 18:23:59 +0000 (20:23 +0200)
* 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

index 24e1ae3f097bbf605c00702987ebbb73180137b6..b3707bb7863fd7a217f10dda6eb3d39d19bb9502 100644 (file)
@@ -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