From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: dick.r.chiang@gmail.com Newsgroups: gmane.emacs.bugs Subject: bug#37063: 26.2.90; Problems with recent CL support in checkdoc Date: Mon, 30 Sep 2019 12:52:36 -0400 Message-ID: <87sgodiv57.fsf@dick> References: <87imqw10je.fsf@cassou.me> Mime-Version: 1.0 Content-Type: text/x-diff Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="239961"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) To: 37063@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Sep 30 18:53:12 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iEyv9-0010Kq-Qp for geb-bug-gnu-emacs@m.gmane.org; Mon, 30 Sep 2019 18:53:11 +0200 Original-Received: from localhost ([::1]:55084 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iEyv7-0003T7-Vp for geb-bug-gnu-emacs@m.gmane.org; Mon, 30 Sep 2019 12:53:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44919) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iEyv1-0003Sx-2a for bug-gnu-emacs@gnu.org; Mon, 30 Sep 2019 12:53:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iEyv0-0004EM-0R for bug-gnu-emacs@gnu.org; Mon, 30 Sep 2019 12:53:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51589) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iEyuz-0004ED-R0 for bug-gnu-emacs@gnu.org; Mon, 30 Sep 2019 12:53:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iEyuz-00049l-Oa for bug-gnu-emacs@gnu.org; Mon, 30 Sep 2019 12:53:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: dick.r.chiang@gmail.com Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 30 Sep 2019 16:53:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 37063 X-GNU-PR-Package: emacs Original-Received: via spool by 37063-submit@debbugs.gnu.org id=B37063.156986236515951 (code B ref 37063); Mon, 30 Sep 2019 16:53:01 +0000 Original-Received: (at 37063) by debbugs.gnu.org; 30 Sep 2019 16:52:45 +0000 Original-Received: from localhost ([127.0.0.1]:60410 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iEyui-00049D-WD for submit@debbugs.gnu.org; Mon, 30 Sep 2019 12:52:45 -0400 Original-Received: from mail-qt1-f172.google.com ([209.85.160.172]:36198) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iEyuh-00048z-MK for 37063@debbugs.gnu.org; Mon, 30 Sep 2019 12:52:44 -0400 Original-Received: by mail-qt1-f172.google.com with SMTP id o12so17917379qtf.3 for <37063@debbugs.gnu.org>; Mon, 30 Sep 2019 09:52:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:references:date:in-reply-to:message-id:user-agent :mime-version:content-disposition:content-description; bh=UomRc+uNErI/hvGI5Brk+xgRnRMpCPjZXS5vo6ASXeY=; b=kW9ZUx63Ob0Q+gM167gZu1UmRDHszgv4sgEHOteCPQVUKF2xVJQDIk3PSfRaks/2MV PxYrkqGvTgL6tTGITXt6jNF6zr3oaRSKCwJ0RmI4v8rlromMJuSZNGV1GXjQzHH1MkZj KK+gquhDTA88Ld/XsbrDGHXAbIwhwEIRvcbezISE0iID81ANFQstZsweOFxXST0Iolzw KWht/iIcN4M2J87NXE/VCHMWhqlZlPcexRMo5/wmppYzpq/5DabR4iBbVnaG4JtUafq6 qBmQowwd3Qa+t37RPa2GM6K0SC0Qc9VCPuutOVdHXmMtQCb1TNPvA+XHGDdt/uSau1a6 dYBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-disposition :content-description; bh=UomRc+uNErI/hvGI5Brk+xgRnRMpCPjZXS5vo6ASXeY=; b=S1JMNjRDj6Bmc3BuGpgLDb6SbofsiSAeLvVrsBtmfF1PuYEYmidvGAvLp7KVcia6V4 qZ1uKuLBgNP3txE1keIJelqNb+62xDS74J+PEn1gjC209MWplwDtZCvSrosh6B8EGq6g yR7gMyFp7G55ElAq61yN4hKTjv1u1hTOJoE9c0bkliB41CkuTXkNQJ8nOIxVIFQ/aTMR V27CFVjjtngCyC03KOr6uP5vP/TbuR+BWARAhKorDjuGtZEPggg6mVombwsZL8gLbM3+ ViU3ucSW6f/fwwKncAq1DoBK3q+OVcWvL+Lwf69FG9y3DNBk/iXLXYA9wJK9QipFd6w+ i/hw== X-Gm-Message-State: APjAAAV3atizW3hJidLCfQT6g2NxLi6A9cPNfjjNJDO4aBo2H96a3ZuI DgjAGIIb5IoD8NO6idkx6QVQjAZi X-Google-Smtp-Source: APXvYqw/CuWgOs43h+G15xA8kg1GPWEnPtfuCAesesiRLzc6hjoJ486UM7exQiArB1wAeVjSzSThmA== X-Received: by 2002:ad4:4251:: with SMTP id l17mr21514165qvq.148.1569862357831; Mon, 30 Sep 2019 09:52:37 -0700 (PDT) Original-Received: from localhost (pool-100-33-98-8.nycmny.fios.verizon.net. [100.33.98.8]) by smtp.gmail.com with ESMTPSA id z200sm6486060qkb.5.2019.09.30.09.52.37 for <37063@debbugs.gnu.org> (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 Sep 2019 09:52:37 -0700 (PDT) X-Google-Original-From: 37063@debbugs.gnu.org In-Reply-To: <87imqw10je.fsf@cassou.me> (Damien Cassou's message of "Sat, 17 Aug 2019 13:41:57 +0200") Content-Disposition: inline; filename=0001-checkdoc-identifying-formal-args.patch Content-Description: checkdoc fix X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:167931 Archived-At: >From c97b08a1d6df46f674a18ab83ae86dc6a5ad3aa0 Mon Sep 17 00:00:00 2001 From: dickmao Date: Mon, 30 Sep 2019 10:04:49 -0400 Subject: [PATCH] ; checkdoc identifying formal args * lisp/emacs-lisp/checkdoc.el (checkdoc-defun-info): * test/lisp/emacs-lisp/checkdoc-tests.el: (Bug#37063) --- lisp/emacs-lisp/checkdoc.el | 5 ++--- test/lisp/emacs-lisp/checkdoc-tests.el | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el index 51fb75da69..6c40bdf632 100644 --- a/lisp/emacs-lisp/checkdoc.el +++ b/lisp/emacs-lisp/checkdoc.el @@ -1952,11 +1952,10 @@ checkdoc-defun-info ;; new obarray. (if (not (listp lst)) (setq lst nil)) (unless is-advice - ;; lst here can be something like ((foo bar) baz) from + ;; (car lst) can be something like ((foo bar) baz) from ;; cl-lib methods; flatten it: - (setq lst (flatten-tree lst)) (while lst - (setq ret (cons (symbol-name (car lst)) ret) + (setq ret (cons (symbol-name (car (flatten-tree (car lst)))) ret) lst (cdr lst))))) (nreverse ret)))) diff --git a/test/lisp/emacs-lisp/checkdoc-tests.el b/test/lisp/emacs-lisp/checkdoc-tests.el index 1cefc4c366..b3cc943ac0 100644 --- a/test/lisp/emacs-lisp/checkdoc-tests.el +++ b/test/lisp/emacs-lisp/checkdoc-tests.el @@ -50,4 +50,20 @@ checkdoc-tests--next-docstring (should (looking-at-p "\"baz\")")) (should-not (checkdoc-next-docstring)))) +(ert-deftest checkdoc-tests--cl-defun () + "Identify formal arguments from arbitary lisp code." + (with-temp-buffer + (let ((checkdoc-autofix-flag 'never)) + (emacs-lisp-mode) + (insert "(cl-defun foo(&key bar &aux (baz (baz bar))) \"BAR BAZ.\")") + (should-not (checkdoc-defun))))) + +(ert-deftest checkdoc-tests--cl-defmethod () + "Identify formal arguments from object types." + (with-temp-buffer + (let ((checkdoc-autofix-flag 'never)) + (emacs-lisp-mode) + (insert "(cl-defmethod foo((a list)) \"Return A.\")") + (should-not (checkdoc-defun))))) + ;;; checkdoc-tests.el ends here -- 2.23.0