diff options
| author | Stefan Kangas | 2025-03-06 00:33:21 +0100 |
|---|---|---|
| committer | Stefan Kangas | 2025-03-06 00:47:24 +0100 |
| commit | 679966b5a091106d37a2e2e769d9e87f3fb92a63 (patch) | |
| tree | 1ce2eef0f70e427634f1824c525b3766d26aef11 | |
| parent | fac9097b16310cf7af058ef5ff26c86697b24a32 (diff) | |
| download | emacs-679966b5a091106d37a2e2e769d9e87f3fb92a63.tar.gz emacs-679966b5a091106d37a2e2e769d9e87f3fb92a63.zip | |
New user option checkdoc-arguments-missing-flag
* lisp/emacs-lisp/checkdoc.el
(checkdoc-arguments-missing-flag): New user option.
(checkdoc-this-string-valid-engine): Use above new option.
(checkdoc--argument-missing-flag): Make into obsolete variable alias for
above new option.
| -rw-r--r-- | etc/NEWS | 5 | ||||
| -rw-r--r-- | lisp/emacs-lisp/checkdoc.el | 18 |
2 files changed, 14 insertions, 9 deletions
| @@ -931,6 +931,11 @@ This change affects both 'M-x checkdoc' and the corresponding flymake | |||
| 931 | backend. | 931 | backend. |
| 932 | 932 | ||
| 933 | --- | 933 | --- |
| 934 | *** New user option 'checkdoc-arguments-missing-flag'. | ||
| 935 | Set this to nil to disable warnings for function arguments that are not | ||
| 936 | documented in docstrings. | ||
| 937 | |||
| 938 | --- | ||
| 934 | *** Checkdoc will now flag incorrect formatting in warnings. | 939 | *** Checkdoc will now flag incorrect formatting in warnings. |
| 935 | This affects calls to 'warn', 'lwarn', 'display-warning', and | 940 | This affects calls to 'warn', 'lwarn', 'display-warning', and |
| 936 | 'message-box'. | 941 | 'message-box'. |
diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el index 95fa3a2027e..c3b43b6a97b 100644 --- a/lisp/emacs-lisp/checkdoc.el +++ b/lisp/emacs-lisp/checkdoc.el | |||
| @@ -353,19 +353,19 @@ See Info node `(elisp) Documentation Tips' for background." | |||
| 353 | ;; This is how you can use checkdoc to make mass fixes on the Emacs | 353 | ;; This is how you can use checkdoc to make mass fixes on the Emacs |
| 354 | ;; source tree: | 354 | ;; source tree: |
| 355 | ;; | 355 | ;; |
| 356 | ;; (setq checkdoc--argument-missing-flag nil) ; optional | 356 | ;; (setq checkdoc-arguments-missing-flag nil) ; optional |
| 357 | ;; (setq checkdoc--disambiguate-symbol-flag nil) ; optional | 357 | ;; (setq checkdoc--disambiguate-symbol-flag nil) ; optional |
| 358 | ;; (setq checkdoc--interactive-docstring-flag nil) ; optional | 358 | ;; (setq checkdoc--interactive-docstring-flag nil) ; optional |
| 359 | ;; (setq checkdoc-permit-comma-termination-flag t) ; optional | 359 | ;; (setq checkdoc-permit-comma-termination-flag t) ; optional |
| 360 | ;; (setq checkdoc-verb-check-experimental-flag nil) | ||
| 361 | ;; Then use `M-x find-dired' ("-name '*.el'") and `M-x checkdoc-dired' | 360 | ;; Then use `M-x find-dired' ("-name '*.el'") and `M-x checkdoc-dired' |
| 362 | 361 | ||
| 363 | (defvar checkdoc--argument-missing-flag t | 362 | (define-obsolete-variable-alias 'checkdoc--argument-missing-flag |
| 364 | "Non-nil means warn if arguments are missing from docstring. | 363 | 'checkdoc-arguments-missing-flag "31.1") |
| 365 | This variable is intended for use on Emacs itself, where the | 364 | (defcustom checkdoc-arguments-missing-flag t |
| 366 | large number of libraries means it is impractical to fix all | 365 | "Non-nil means warn if function arguments are missing from docstring." |
| 367 | of these warnings en masse. In almost any other case, setting | 366 | :type 'boolean |
| 368 | this to anything but t is likely to be counter-productive.") | 367 | :version "31.1") |
| 368 | ;;;###autoload(put 'checkdoc-arguments-missing-flag 'safe-local-variable 'booleanp) | ||
| 369 | 369 | ||
| 370 | (defvar checkdoc--disambiguate-symbol-flag t | 370 | (defvar checkdoc--disambiguate-symbol-flag t |
| 371 | "Non-nil means ask to disambiguate Lisp symbol. | 371 | "Non-nil means ask to disambiguate Lisp symbol. |
| @@ -1852,7 +1852,7 @@ function,command,variable,option or symbol." ms1)))))) | |||
| 1852 | (looking-at "[.?!]"))) | 1852 | (looking-at "[.?!]"))) |
| 1853 | (insert ".")) | 1853 | (insert ".")) |
| 1854 | nil) | 1854 | nil) |
| 1855 | (when checkdoc--argument-missing-flag | 1855 | (when checkdoc-arguments-missing-flag |
| 1856 | (checkdoc-create-error | 1856 | (checkdoc-create-error |
| 1857 | (format-message | 1857 | (format-message |
| 1858 | "Argument `%s' should appear (as %s) in the doc string" | 1858 | "Argument `%s' should appear (as %s) in the doc string" |