From nberrios.fsu at gmail.com Mon Dec 5 17:42:47 2016 From: nberrios.fsu at gmail.com (Nicholas Berrios) Date: Mon, 5 Dec 2016 16:42:47 -0600 Subject: [code-quality] Supplying line numbers to flake8 Message-ID: Hello! I like to use Vim to highlight blocks of code and perform various functions on them. One thing I have always wanted to do is highlight a block of code in a large file and run flake8 on just those lines. I have tried to figure out how flake8 is doing this internally, because it is available through some kind of interaction with the --diff flag when supplied with a unified diff. So my questions are, 1) Is there already an invocation syntax I can use to run flake8 on a certain line # range in a file 2) If not, where can I dig around in the source code to see how --diff does this? Thanks a ton, and best wishes! Nick Berrios -------------- next part -------------- An HTML attachment was scrubbed... URL: From mail at svenbrauch.de Mon Dec 26 09:05:23 2016 From: mail at svenbrauch.de (Sven Brauch) Date: Mon, 26 Dec 2016 15:05:23 +0100 Subject: [code-quality] Using the pycodestyle API Message-ID: <2d6452ca-c9c7-40d0-c0dc-2ae5a91b8609@svenbrauch.de> Hi, I'm trying to use pycodestyle from a custom script. Importing the "Checker" class and passing some lines to check works, but how can I specify which errors to select or ignore? The API docs [1] are a bit lacking. Thank you and best regards, Sven ______________ [1] https://github.com/PyCQA/pycodestyle/blob/master/docs/api.rst#checker-classes -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: OpenPGP digital signature URL: From graffatcolmingov at gmail.com Mon Dec 26 13:02:20 2016 From: graffatcolmingov at gmail.com (Ian Cordasco) Date: Mon, 26 Dec 2016 12:02:20 -0600 Subject: [code-quality] Using the pycodestyle API In-Reply-To: <2d6452ca-c9c7-40d0-c0dc-2ae5a91b8609@svenbrauch.de> References: <2d6452ca-c9c7-40d0-c0dc-2ae5a91b8609@svenbrauch.de> Message-ID: On Mon, Dec 26, 2016 at 8:05 AM, Sven Brauch wrote: > Hi, > > I'm trying to use pycodestyle from a custom script. Importing the > "Checker" class and passing some lines to check works, but how can I > specify which errors to select or ignore? The API docs [1] are a bit > lacking. Hey Sven, The Checker class isn't really best suited to this use-case. You really want to be using the StyleGuide object. Also you probably want to look at the rendered documentation [0] Cheers, Ian [0]: http://pycodestyle.pycqa.org/en/latest/api.html