From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Mark Oteiza Newsgroups: gmane.emacs.devel Subject: Re: Flymake refactored Date: Fri, 06 Oct 2017 09:04:30 -0400 Message-ID: <87o9pkh1gh.fsf@udel.edu> References: <87h8vmj3tr.fsf@lolita> <1507138648.1972.0@smtp.gmail.com> <874lre2von.fsf@gmail.com> <87mv566yjx.fsf@udel.edu> <87shex276r.fsf@gmail.com> <87efqh2sud.fsf@udel.edu> <877ew919hd.fsf@gmail.com> <87k208n45h.fsf@metapensiero.it> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1507295098 30315 195.159.176.226 (6 Oct 2017 13:04:58 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 6 Oct 2017 13:04:58 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.60 (gnu/linux) Cc: emacs-devel@gnu.org To: Lele Gaifax Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Oct 06 15:04:48 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e0SJ3-0006YG-U7 for ged-emacs-devel@m.gmane.org; Fri, 06 Oct 2017 15:04:46 +0200 Original-Received: from localhost ([::1]:44844 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0SJB-0005uc-EM for ged-emacs-devel@m.gmane.org; Fri, 06 Oct 2017 09:04:53 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57014) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0SIw-0005rO-7X for emacs-devel@gnu.org; Fri, 06 Oct 2017 09:04:43 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0SIs-0005g5-Bi for emacs-devel@gnu.org; Fri, 06 Oct 2017 09:04:38 -0400 Original-Received: from mail-qk0-x230.google.com ([2607:f8b0:400d:c09::230]:55652) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0SIs-0005fJ-6T for emacs-devel@gnu.org; Fri, 06 Oct 2017 09:04:34 -0400 Original-Received: by mail-qk0-x230.google.com with SMTP id x82so7860631qkb.12 for ; Fri, 06 Oct 2017 06:04:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=udel-edu.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=xCHJqG7kow2flgZslWbGm33fyg58FJWlxf0/OeEooQw=; b=U9vJ7Rhbvs6ipOa/um65gkDMVgUtizO36sYRUgIkzXAa++/9DZE/d3diP2N9ybcrTE xSigj7I8qIeoUIEZYZ6WRpBucNNuEoWb/vAerrjBsVTbMzrn0cJwRXzzr5hpaAGrGZkn 24yH57pZVgZYja1JChsC2bM17/qRgf8ztiUSuQzYGLE5MmzGwnHmCDpnOUYljHpddIM8 V8935rSxeVehUCfYnuEPaRmOxov7/l3nqxlxm3VWoveJI4EMRuVP6kSmaLG4glap8CFE +q/wunnU75LO6/BSsoKcDvYkBbwcIqMcApE3GG60akxuYEn040BYFmQWEemTAKyADtPd dmmQ== 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=xCHJqG7kow2flgZslWbGm33fyg58FJWlxf0/OeEooQw=; b=BnbB9WagwpwUH6hLBWA6Mme5/bx3GnRYy6p+xBAuWVD2q071Fzd2OyvcyBr2CW9woZ DZqurEFqVF06JQjzyEzZ2b5sIvUoqBweOO2JZSldNLcs4FxU2Du5gpyGwJ5bLcebBW1w /0V/+R8LKgIK2HRtGaHy/fvCzf0/04f/Ih1sEzzGnLGitAdt4i261+fMq9zEUEKktDEF 8MGZNq63aWW9SAZN6wsxdsBxSd7jRiLjOdH9xx3Hj9Z8Qbs04+F1Syixrbpfv4pSYVW8 jPfqDwFNCYpDbOmO+oC+nFjGdPZ4rHtwCZKj5Ofn3m3hpzMPKO7UUPl5MsfFvC5NG1wg wp/A== X-Gm-Message-State: AMCzsaWLoKGlKWil42VIrpkropJVNT9UNMBwovc39H5f4otE5/0unq+c cwBMNgDbibED+i+ar21SMC5J/z5fLMmw3A== X-Google-Smtp-Source: AOwi7QC1/w/DUSNWBHzAWDvCZcU5p/NgAzFa9fZVn8p0lPg7/PU1aVrQuaum99jDC7e4WGcNy7vjhw== X-Received: by 10.55.136.69 with SMTP id k66mr27022343qkd.54.1507295072421; Fri, 06 Oct 2017 06:04:32 -0700 (PDT) Original-Received: from logos (pool-173-67-36-61.bltmmd.fios.verizon.net. [173.67.36.61]) by smtp.gmail.com with ESMTPSA id w28sm903009qtw.50.2017.10.06.06.04.31 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 06 Oct 2017 06:04:31 -0700 (PDT) In-Reply-To: <87k208n45h.fsf@metapensiero.it> (Lele Gaifax's message of "Fri, 06 Oct 2017 09:09:46 +0200") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::230 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:219178 Archived-At: Lele Gaifax writes: > Stefan Monnier writes: > >> I think the Python backend would naturally belong in python.el > > I'm attaching what I'm currently testing out: how should I proceed to > contribute it? A small patch on top of it: this facilitates configuring the checker to instead be flake8, which is a wrapper around a few checkers, including pyflakes http://flake8.pycqa.org/en/latest/ https://pypi.python.org/pypi/flake8 To use flake8, the command should be '("flake8" "-"), the output regexp ^stdin:\(?1:[0-9]+\):\(?:\(?2:[0-9]+\):\)? \(?3:.*\)$ and lifting from flycheck, the alist '(("^E9.*$" . :error) ("^F82.*$" . :error) ("^F83.*$" . :error) ("^D.*$" . :info) ("^N.*$" . :info)) --- lisp/progmodes/python.el 2017-10-06 08:55:36.328201056 -0400 +++ lisp/progmodes/python2.el 2017-10-06 08:56:18.424137623 -0400 @@ -5160,9 +5160,9 @@ :group 'python-flymake :type 'regexp) -(defcustom python-flymake-warn-msg-regexp - "\\(^redefinition\\|.*unused.*\\|used$\\)" - "The regexp used to discriminate warnings from errors." +(defcustom python-flymake-msg-alist + '(("\\(^redefinition\\|.*unused.*\\|used$\\)" . :warning)) + "Alist used to associate messages with their types." :group 'python-flymake :type 'regexp) @@ -5204,9 +5204,10 @@ (and (match-string 2) (string-to-number (match-string 2)))) - for type = (if (string-match - python-flymake-warn-msg-regexp msg) - :warning :error) + for type = (or (assoc-default msg + python-flymake-msg-alist + #'string-match) + :error) collect (flymake-make-diagnostic source beg end type msg) into diags