From unknown Fri Jun 13 15:07:53 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#28821 <28821@debbugs.gnu.org> To: bug#28821 <28821@debbugs.gnu.org> Subject: Status: [PATCH] Implement Python backend for Flymake Reply-To: bug#28821 <28821@debbugs.gnu.org> Date: Fri, 13 Jun 2025 22:07:53 +0000 retitle 28821 [PATCH] Implement Python backend for Flymake reassign 28821 emacs submitter 28821 joaotavora@gmail.com (Jo=C3=A3o T=C3=A1vora) severity 28821 normal tag 28821 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 13 16:56:44 2017 Received: (at submit) by debbugs.gnu.org; 13 Oct 2017 20:56:44 +0000 Received: from localhost ([127.0.0.1]:38477 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e370e-0004Zk-JV for submit@debbugs.gnu.org; Fri, 13 Oct 2017 16:56:44 -0400 Received: from eggs.gnu.org ([208.118.235.92]:33249) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e370c-0004ZX-Ps for submit@debbugs.gnu.org; Fri, 13 Oct 2017 16:56:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e370W-00087U-LW for submit@debbugs.gnu.org; Fri, 13 Oct 2017 16:56:37 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:36868) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e370W-00087N-IP for submit@debbugs.gnu.org; Fri, 13 Oct 2017 16:56:36 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52444) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e370V-00018Q-89 for bug-gnu-emacs@gnu.org; Fri, 13 Oct 2017 16:56:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e370R-00085k-B7 for bug-gnu-emacs@gnu.org; Fri, 13 Oct 2017 16:56:35 -0400 Received: from mail-wr0-x22c.google.com ([2a00:1450:400c:c0c::22c]:54736) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e370R-00085L-3X for bug-gnu-emacs@gnu.org; Fri, 13 Oct 2017 16:56:31 -0400 Received: by mail-wr0-x22c.google.com with SMTP id o44so1854472wrf.11 for ; Fri, 13 Oct 2017 13:56:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=KRsnWzUOedf1lUEgarXL6aacR+NKygQfdgohJTv8nh0=; b=m+n5aDnSK1ipxuu/QxcnTf71jNHUFD/AP5zYPUGRuDfUkIGYD7baNqD6xAIDXh22zz +kHOU+v+tcg46vjd+A/Iguw5XLFvLMWdCTc741pMzNXphLufONbGoKU4eORa3remfGy1 ywtzLd1z5uI047u7JH76N9rlKNG7DfYVjbHsu6SZlUL2PazfoZthmhEkRihOL++ZC3YL 3gNKfC+eB/xxvRqskoObg26i3/w+JhGRppeMJ+pF/B1cWsQBMYAZq1rFxMtdOrk4L9ao LgDOdEclK78xIL5ip8XoEVHpX8ey/UPng3yP6Jiaanhqz+lr/+iBRgqX99Uo8x8dzy1n AgNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=KRsnWzUOedf1lUEgarXL6aacR+NKygQfdgohJTv8nh0=; b=EaBnobQodfSYBxj3qci/dBE6bUkd3s+/oLXhvCHCZAFhZJaTrgdEoL49ryEoaE5jIz 5GO70klH+aBNgjFFp/OINK8944ZRHl4mQhDbqsUAf9CbZImSBb31vN0FJdETxe7WNUXY gwYD0RLmPal2yvNU7ndL+iypYBiVfzSNyE3AWL2OaSkrm6xFuKi/CQ2Ys0qqmAkgX9KC e7eKpFZ3GibfZGzsFR1WuJ6bCTxpEF2Hc2HnABkWTQXnMK9Io2vQidAm86PVV5yx+ICe jYUXpkyF+spru0vCzZvAClo/r5Bs7302pp7DI0YcVjzD8zxp6PP8fJM44PV1PMZyN9Mv hK3Q== X-Gm-Message-State: AMCzsaWaqQ4PQ1jR+3ZkFfYMexi8gQaWymCOLxQZGf2OVU+bZ9yHLQY+ uYtV3o4pRBTMBw188Iv1ogyxezBZ X-Google-Smtp-Source: AOwi7QD2flRSQTM4FxJIfKhGYCCRh0YGn1TUBEZGvsaa16LRwY2jI1o2fIWJsu1lj52JFkF2VuBxPg== X-Received: by 10.223.142.45 with SMTP id n42mr2230230wrb.278.1507928189546; Fri, 13 Oct 2017 13:56:29 -0700 (PDT) Received: from lolita.yourcompany.com (188.139.62.94.rev.vodafone.pt. [94.62.139.188]) by smtp.gmail.com with ESMTPSA id 38sm1487419wrl.76.2017.10.13.13.56.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Oct 2017 13:56:28 -0700 (PDT) From: joaotavora@gmail.com (=?utf-8?B?Sm/Do28gVMOhdm9yYQ==?=) To: Lele Gaifax Subject: Re: [PATCH] Implement Python backend for Flymake References: <87y3of2zbj.fsf@metapensiero.it> Date: Fri, 13 Oct 2017 21:56:25 +0100 In-Reply-To: <87y3of2zbj.fsf@metapensiero.it> (Lele Gaifax's message of "Fri, 13 Oct 2017 11:04:48 +0200") Message-ID: <87bmlan4w6.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit Cc: bug-gnu-emacs@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) Hi Lele, Here are some comments: Lele Gaifax writes: > +(defgroup python-flymake nil > + "Integration between Python and Flymake." > + :group 'python > + :link '(custom-group-link :tag "Flymake" flymake) > + :version "26.1") > + > +(defcustom python-flymake-command '("pyflakes") > + "The external tool that will be used to perform the syntax check. > +This is a non empty list of strings, the checker tool possibly followed by > +required arguments: to use `flake8' you would set this to (\"flake8\" \"-\")." > I wonder if you shouldn't mention here that the command produced should, once invoked, check (a file? a chunk?) of python source code passed to it via its standard input. > + :group 'python-flymake > + :type '(repeat string)) > + > +;; The default regexp accomodates for older pyflakes, which did not > +;; report the column number > +(defcustom python-flymake-command-output-regexp > + "^\\(?:\\):\\(?1:[0-9]+\\):\\(?:\\(?2:[0-9]+\\):\\)? \\(?3:.*\\)$" > + "The regexp used to parse the output of the specified tool. > +It must contain two or three groups: group 1 is the line number, group 2 the > +optional column number and the third is the actual message." A common trick here that old flymake (and also compile.el) use is to define the variable's value as list (REGEXP LINE COLUMN TYPE MESSAGE). REGEXP is mandatory. LINE, COLUMN, TYPE and MESSAGE are non-negative integer numbers designating regexp groups, or nil. In the latter case it means the regexp cannot capture that entity. So in your case it would become (defcustom python-flymake-command-output-regexp (list "^\\(?:\\):\\(?1:[0-9]+\\):\\(?:\\(?2:[0-9]+\\):\\)? \\(?3:.*\\)$" 1 2 nil 3) "docstring" :group 'python-flymake :type '(list string (choice integer symbol) (choice integer symbol) (choice integer symbol) (choice integer symbol))) Perhaps TYPE does not make much sense currently. But it would match slightly better with compilation-error-regexp-alist in the future (which you should see). > + (unless (derived-mode-p 'python-mode) > + (error "Can only work on `python-mode' buffers")) Stefan and I arrived at the conclusion that this is cruft and isn't needed. > +(defun python-flymake-activate () Rename this to python--flymake-setup, because "activation" is actually enabling flymake-mode. Also, I think you should add an autoload cookie to python--flymake-setup and then call that function from the end of python-mode. The > + "Activate the Flymake syntax check on all python-mode buffers." > + (add-hook 'flymake-diagnostic-functions #'python-flymake nil t)) I'd use 'python-flymake instead of #'python-flymake in add-hook, but I can't offer a sound reason why :-) From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 13 17:00:56 2017 Received: (at 28821) by debbugs.gnu.org; 13 Oct 2017 21:00:56 +0000 Received: from localhost ([127.0.0.1]:38485 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e374i-0004hq-Er for submit@debbugs.gnu.org; Fri, 13 Oct 2017 17:00:56 -0400 Received: from mail-wr0-f173.google.com ([209.85.128.173]:49232) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e374g-0004hb-1J for 28821@debbugs.gnu.org; Fri, 13 Oct 2017 17:00:54 -0400 Received: by mail-wr0-f173.google.com with SMTP id g90so848853wrd.6 for <28821@debbugs.gnu.org>; Fri, 13 Oct 2017 14:00:53 -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-transfer-encoding; bh=noLqPXyMNoNy4nJJUk8w3Q8pSB8CLfm6GcMj3H0oWOs=; b=mJmfroIOA1GI0fzOuS/valwmvKcRh5O+hJdXijJN2oxPf9w1neqBTImTx9/hkeg1/m hwJFng0t7z2J/Y1OJS154V7q2H6JVkTTIREA3fv4rZwaLfxGqA2kmKqtguQ7Om11TxDj P1iZdtE5g//rF6E4hZWsXCBTbZkqNzT4RXCRubH9Oe+62Hi7lntm9y880A5j53yVS8SW 5UzzsXudqaMEZa0YKVVY9auD2PDiTNglsg7aWLlvCoD49M9HvATTGKxUUWE5+y1wz/tp u/MyBCclGY7BkYbZlM2h1EBmFUsnfoGMsvIDqXnHFDdxZZKgn5GnEs4uvQhKnraQUIJu +xNQ== 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-transfer-encoding; bh=noLqPXyMNoNy4nJJUk8w3Q8pSB8CLfm6GcMj3H0oWOs=; b=OdxvtD5DUj3NuQOKH807G6dm5kYT8piZaveoLaNavjhR3Gy0W2mWYUaPqEQc+ojNeJ IDomCpkm/Pl/HmEnJ4JiAXNWMC3Z40+qg9+58Y2Du40r/uNenAONKqyeytSI1PIjl7GH zPP8HsVkijVE5V2lvNPQ+E+o8az4+UdHqitl9ahuHKLkxVzdlCttIPiYPer0EIG6lLCx JrNGzQz73NNzOwIocvTRrJ/9vvvr6YlsKXRg+62HDL4UCldeDjEP3m1AhaQW4EuRh8Tt h90A0+lgIGSfAVvcuqW6GVtDrRvzGdsJscQqJL7G5tnyKPGapO1xtlvJUi/TXSoDA92r 8QXQ== X-Gm-Message-State: AMCzsaXLica8rjdA3JaEvGHTaELw/6cBoJSUTBGMXJ4C5nfc9+kgERi+ d44KM8h5cmi0xnYWjyTPm+uLctRI X-Google-Smtp-Source: AOwi7QBGg2JXAHT6TcPFmvTmkHI5k5r5Ez2JkJK3/ce2fPETNtwN1VAerx0nHQSHAy7r5UVkCaPW5Q== X-Received: by 10.223.197.131 with SMTP id m3mr2653937wrg.0.1507928447932; Fri, 13 Oct 2017 14:00:47 -0700 (PDT) Received: from lolita.yourcompany.com (188.139.62.94.rev.vodafone.pt. [94.62.139.188]) by smtp.gmail.com with ESMTPSA id j73sm5321495wmf.15.2017.10.13.14.00.46 for <28821@debbugs.gnu.org> (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Oct 2017 14:00:47 -0700 (PDT) From: joaotavora@gmail.com (=?utf-8?B?Sm/Do28gVMOhdm9yYQ==?=) To: 28821@debbugs.gnu.org Subject: Re: bug#28821: Acknowledgement ([PATCH] Implement Python backend for Flymake) References: <87bmlan4w6.fsf@gmail.com> Date: Fri, 13 Oct 2017 22:00:45 +0100 In-Reply-To: (GNU bug Tracking System's message of "Fri, 13 Oct 2017 20:57:04 +0000") Message-ID: <877evyn4oy.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.8 (--) X-Debbugs-Envelope-To: 28821 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.8 (--) Sorry, This is not at all what I meant to do, I've created a new bug but I merely meant to reply to Lele's bug report 28808. I'll try to archive or close 28821, since it is useless. Jo=C3=A3o From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 13 17:13:49 2017 Received: (at 28821-done) by debbugs.gnu.org; 13 Oct 2017 21:13:49 +0000 Received: from localhost ([127.0.0.1]:38520 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e37HB-000540-81 for submit@debbugs.gnu.org; Fri, 13 Oct 2017 17:13:49 -0400 Received: from mail-wm0-f49.google.com ([74.125.82.49]:53123) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e37HA-00053l-2s for 28821-done@debbugs.gnu.org; Fri, 13 Oct 2017 17:13:48 -0400 Received: by mail-wm0-f49.google.com with SMTP id k4so24030496wmc.1 for <28821-done@debbugs.gnu.org>; Fri, 13 Oct 2017 14:13:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:user-agent:date:message-id:mime-version; bh=DwiSg7uEYfecyqHdUQzcu2xmHhccQ4C4zHWgYQJ243U=; b=Oe2edab2i3rreYZrl/KYloK8e9/SjyZrXqiDc56MFA/ccpTaVxHNfGY4wh7lwSZulM Dmkjn8CycGfxxl6Vw6tF3eIgVl+SRXcshg9I5FzFMJ7SodBYXUlFyJSEFbpYaAhHYOds 1ycYs3UQDBsGjWXywXCP50gYGxSxBLdrhDbAU7f21L68+92DtLIJscgLTavypAlcUnqo SfUWdT99QS1KKsUQeOit7PHH9czQVJOVemkHbV4T8G78aaiuarLaXAGQ8TuezmMS9MRq JVHBG5tPSNhR95tDPfYUOtVApOv7JpxIBJvNictN9jx8DVzdOdVzIN2+mW9YtpxTOzze 9NPA== 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:user-agent:date:message-id :mime-version; bh=DwiSg7uEYfecyqHdUQzcu2xmHhccQ4C4zHWgYQJ243U=; b=BuxtnK0P2soEjb/TuGqLiqurJq5hteNEEF2Sh10o3gmnUDnoU7zTFk6h0XDFu8c7p6 sznjkTqfOcpJFtIquxHMA+KOFHrvSPb5GfFTmvCz0TqvsCZ+ENXOpPYuL/cyomT71DPv 4KmoURf+g54vvLpmI4a5tPFBilSKK88/Wwbjmdu6jpenGoH6LrnylDbZoS28wowQOxw/ g2xZl+aw0Cj2ypsPdY4Vdnq6ErKebPhXOLgAGlR3C6zaU/hBbz01kignJfzltD4SxEyl 3R9X9/JuWyaQdKLPNvEAIne4p3HP5pEo4zKG/MJVKTK5xxkNxt3mGsSh5sg65uPxoxeg kfIg== X-Gm-Message-State: AMCzsaUlly8TgnDHubHaSrz9PppJ4idL/hvTBO6bf45Iy7NBQma23yU8 6ew6gWo0b2Zt1uTtcJU/vw83k0S7Mjc= X-Google-Smtp-Source: AOwi7QBFFPpJF5q26YZAJFHr/CvvW48reBUcNJ3nnSuBPDZoX10eTJ0NhqcD/UAMLMZNug6MvhZOmg== X-Received: by 10.28.109.220 with SMTP id b89mr2572890wmi.30.1507929221250; Fri, 13 Oct 2017 14:13:41 -0700 (PDT) Received: from lolita.yourcompany.com (188.139.62.94.rev.vodafone.pt. [94.62.139.188]) by smtp.gmail.com with ESMTPSA id b16sm2844076wrg.95.2017.10.13.14.13.40 for <28821-done@debbugs.gnu.org> (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Oct 2017 14:13:40 -0700 (PDT) From: joaotavora@gmail.com (=?utf-8?B?Sm/Do28gVMOhdm9yYQ==?=) To: 28821-done@debbugs.gnu.org Subject: Closing this bug created in error User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux) Date: Fri, 13 Oct 2017 22:13:38 +0100 Message-ID: <87o9palpj1.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 28821-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) This bug was created in error by cc'ing bug-gnu-emacs@gnu.org. The relevant bug is 28808. Sorry. From unknown Fri Jun 13 15:07:53 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 11 Nov 2017 12:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator