From carl.crowder at gmail.com Fri Apr 6 18:37:08 2018 From: carl.crowder at gmail.com (Carl Crowder) Date: Sat, 07 Apr 2018 00:37:08 +0200 Subject: [code-quality] Some other additions to PyCQA possibly In-Reply-To: References: Message-ID: <183aaf41-82df-4dd0-8f39-a9638c07eca7@getmailbird.com> Hi there, Finally got around to moving this. Since it's so tightly tied to Landscape.io I wasn't quite sure the best way to do it but that project is EOL really. Finally made the leap. Prospector is now under PyCQA. Cheers, Carl On 22/03/2018 01:48:06, Carlos Co?lho wrote: Any news on moving prospector to PyCQA? Em 8 de mar de 2018, ?(s) 21:06, Carl Crowder escreveu: I would say that the motivation of pylint-plugin-utils was twofold: First - it was a bit of a pain to try to figure out how to write a plugin. This was about 5 years ago though so not sure if that is still true but it took me a while to figure out. Docs on that could be better. Second - it was really just a utility to make it easier to do several things which were useful, such as ?skip this error in this context? or ?add this error in this context?. I definitely think the plugin API in pylint could be easier to use, I?m not sure if pylint-plugin-utils is the answer because it?s just a bandaid really. It could be useful to see the symptoms it was trying to solve though. Carl On 8 March 2018 at 21:51:29, Ashley Whetter (ashley at awhetter.co.uk [mailto:ashley at awhetter.co.uk]) wrote: Does it make more sense to try and merge pylint plugin utils into pylint core? If the plugin interface is clunky enough on its own that there exists utilities for creating plugins, then I think that's an issue that we need to look at resolving. I've been taking a look at this repository recently for the per directory config project in pylint to get sense of how the plugin interface is being used and getting ideas for the kind of thing that we should be aiming for. Ashley _______________________________________________ code-quality mailing list code-quality at python.org [mailto:code-quality at python.org] https://mail.python.org/mailman/listinfo/code-quality [https://mail.python.org/mailman/listinfo/code-quality] -------------- next part -------------- An HTML attachment was scrubbed... URL: From graffatcolmingov at gmail.com Fri Apr 6 19:24:19 2018 From: graffatcolmingov at gmail.com (Ian Stapleton Cordasco) Date: Fri, 6 Apr 2018 18:24:19 -0500 Subject: [code-quality] Some other additions to PyCQA possibly In-Reply-To: <183aaf41-82df-4dd0-8f39-a9638c07eca7@getmailbird.com> References: <183aaf41-82df-4dd0-8f39-a9638c07eca7@getmailbird.com> Message-ID: Woot!!! On Fri, Apr 6, 2018 at 5:37 PM, Carl Crowder wrote: > Hi there, > > Finally got around to moving this. Since it's so tightly tied to > Landscape.io I wasn't quite sure the best way to do it but that project is > EOL really. Finally made the leap. > > Prospector is now under PyCQA. > > Cheers, > Carl > > On 22/03/2018 01:48:06, Carlos Co?lho wrote: > > Any news on moving prospector to PyCQA? > > Em 8 de mar de 2018, ?(s) 21:06, Carl Crowder > escreveu: > > I would say that the motivation of pylint-plugin-utils was twofold: > > First - it was a bit of a pain to try to figure out how to write a plugin. > This was about 5 years ago though so not sure if that is still true but it > took me a while to figure out. Docs on that could be better. > > Second - it was really just a utility to make it easier to do several things > which were useful, such as ?skip this error in this context? or ?add this > error in this context?. > > I definitely think the plugin API in pylint could be easier to use, I?m not > sure if pylint-plugin-utils is the answer because it?s just a bandaid > really. It could be useful to see the symptoms it was trying to solve > though. > > Carl > > > On 8 March 2018 at 21:51:29, Ashley Whetter (ashley at awhetter.co.uk) wrote: > > Does it make more sense to try and merge pylint plugin utils into pylint > core? > If the plugin interface is clunky enough on its own that there exists > utilities for creating plugins, then I think that's an issue that we need to > look at resolving. > I've been taking a look at this repository recently for the per directory > config project in pylint to get sense of how the plugin interface is being > used and getting ideas for the kind of thing that we should be aiming for. > > Ashley > > _______________________________________________ > code-quality mailing list > code-quality at python.org > https://mail.python.org/mailman/listinfo/code-quality > > > _______________________________________________ > code-quality mailing list > code-quality at python.org > https://mail.python.org/mailman/listinfo/code-quality > From shane at goubiq.com Sun Apr 15 17:14:20 2018 From: shane at goubiq.com (Shane Creighton-Young) Date: Sun, 15 Apr 2018 17:14:20 -0400 Subject: [code-quality] [feature request] Unused variable warning for "except Exception as e" Message-ID: Hello flake8! I would have expected pyflakes to emit an unused variables warning for "e" on the following code snippet: class ModuleError(Exception): pass try: 1 / 0 except ZeroDivisionError as e: raise ModuleError() Curious if this check can be added. Thank you! -- Shane Creighton-Young shane at goubiq.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From graffatcolmingov at gmail.com Sun Apr 15 21:11:20 2018 From: graffatcolmingov at gmail.com (Ian Stapleton Cordasco) Date: Mon, 16 Apr 2018 01:11:20 +0000 Subject: [code-quality] [feature request] Unused variable warning for "except Exception as e" In-Reply-To: References: Message-ID: Hi Shane, Can you share what version of pyflakes and on what version of python you're running? For future reference, I think the preferred location for ideas and bugs is github.com/PyCQA/pyflakes/issues Sent from my phone with my typo-happy thumbs. Please excuse my brevity On Sun, Apr 15, 2018, 20:09 Shane Creighton-Young wrote: > Hello flake8! > > I would have expected pyflakes to emit an unused variables warning for "e" > on the following code snippet: > > class ModuleError(Exception): > pass > > try: > 1 / 0 > except ZeroDivisionError as e: > raise ModuleError() > > Curious if this check can be added. > > Thank you! > > -- > Shane Creighton-Young > shane at goubiq.com > > _______________________________________________ > code-quality mailing list > code-quality at python.org > https://mail.python.org/mailman/listinfo/code-quality > -------------- next part -------------- An HTML attachment was scrubbed... URL: From shane at goubiq.com Mon Apr 16 09:47:20 2018 From: shane at goubiq.com (Shane Creighton-Young) Date: Mon, 16 Apr 2018 09:47:20 -0400 Subject: [code-quality] [feature request] Unused variable warning for "except Exception as e" In-Reply-To: References: Message-ID: Hi Ian, I am running python 3.6.4 and pyflakes 1.6.0 via flake8 3.5.0. On Sun, Apr 15, 2018 at 9:11 PM, Ian Stapleton Cordasco < graffatcolmingov at gmail.com> wrote: > Hi Shane, > > Can you share what version of pyflakes and on what version of python > you're running? > > For future reference, I think the preferred location for ideas and bugs is > github.com/PyCQA/pyflakes/issues > > Sent from my phone with my typo-happy thumbs. Please excuse my brevity > > On Sun, Apr 15, 2018, 20:09 Shane Creighton-Young > wrote: > >> Hello flake8! >> >> I would have expected pyflakes to emit an unused variables warning for >> "e" on the following code snippet: >> >> class ModuleError(Exception): >> pass >> >> try: >> 1 / 0 >> except ZeroDivisionError as e: >> raise ModuleError() >> >> Curious if this check can be added. >> >> Thank you! >> >> -- >> Shane Creighton-Young >> shane at goubiq.com >> >> _______________________________________________ >> code-quality mailing list >> code-quality at python.org >> https://mail.python.org/mailman/listinfo/code-quality >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From skip.montanaro at gmail.com Wed Apr 18 16:25:26 2018 From: skip.montanaro at gmail.com (Skip Montanaro) Date: Wed, 18 Apr 2018 15:25:26 -0500 Subject: [code-quality] Catching multiple return types Message-ID: Is there a static checker which will catch multiple return types? Consider this dumb example: def func(a, b, c): if c: return (a, b) return 0 I thought pylint had a checker for that, but running with --rcfile=/dev/null didn't complain about the different types being returned. Is there perhaps a checker for that which isn't enabled by default? Or another static tool which will catch it? Thx, Skip From skip.montanaro at gmail.com Wed Apr 18 18:08:53 2018 From: skip.montanaro at gmail.com (Skip Montanaro) Date: Wed, 18 Apr 2018 22:08:53 +0000 Subject: [code-quality] Catching multiple return types In-Reply-To: References: Message-ID: Thanks, good to know. Yet another tool for the kit... S On Wed, Apr 18, 2018, 3:43 PM Dan Stromberg wrote: > > IINM, mypy can catch such things. But that's a different sort of tool of > course. > > On Wed, Apr 18, 2018 at 1:25 PM, Skip Montanaro > wrote: > >> Is there a static checker which will catch multiple return types? >> Consider this dumb example: >> >> def func(a, b, c): >> if c: >> return (a, b) >> return 0 >> >> I thought pylint had a checker for that, but running with >> --rcfile=/dev/null didn't complain about the different types being >> returned. Is there perhaps a checker for that which isn't enabled by >> default? Or another static tool which will catch it? >> >> Thx, >> >> Skip >> _______________________________________________ >> code-quality mailing list >> code-quality at python.org >> https://mail.python.org/mailman/listinfo/code-quality >> > > > > -- > Dan Stromberg > -------------- next part -------------- An HTML attachment was scrubbed... URL: From strombrg at gmail.com Wed Apr 18 16:43:02 2018 From: strombrg at gmail.com (Dan Stromberg) Date: Wed, 18 Apr 2018 13:43:02 -0700 Subject: [code-quality] Catching multiple return types In-Reply-To: References: Message-ID: IINM, mypy can catch such things. But that's a different sort of tool of course. On Wed, Apr 18, 2018 at 1:25 PM, Skip Montanaro wrote: > Is there a static checker which will catch multiple return types? > Consider this dumb example: > > def func(a, b, c): > if c: > return (a, b) > return 0 > > I thought pylint had a checker for that, but running with > --rcfile=/dev/null didn't complain about the different types being > returned. Is there perhaps a checker for that which isn't enabled by > default? Or another static tool which will catch it? > > Thx, > > Skip > _______________________________________________ > code-quality mailing list > code-quality at python.org > https://mail.python.org/mailman/listinfo/code-quality > -- Dan Stromberg -------------- next part -------------- An HTML attachment was scrubbed... URL: From atodorov at mrsenko.com Thu Apr 19 10:25:22 2018 From: atodorov at mrsenko.com (Alexander Todorov) Date: Thu, 19 Apr 2018 17:25:22 +0300 Subject: [code-quality] Catching multiple return types In-Reply-To: References: Message-ID: ?? 19.04.2018 ? 01:08, Skip Montanaro ??????: > Thanks, good to know. Yet another tool for the kit... > > S > > On Wed, Apr 18, 2018, 3:43 PM Dan Stromberg > wrote: > > > IINM, mypy can catch such things.? But that's a different sort of tool of > course. > > On Wed, Apr 18, 2018 at 1:25 PM, Skip Montanaro > wrote: > > Is there a static checker which will catch multiple return types? > Consider this dumb example: > > def func(a, b, c): > ? ? if c: > ? ? ? ? return (a, b) > ? ? return 0 > > I thought pylint had a checker for that, but running with > --rcfile=/dev/null didn't complain about the different types being > returned. Is there perhaps a checker for that which isn't enabled by > default? Or another static tool which will catch it? > Sounds like _check_consistent_returns in checkers/refactoring.py needs to be updated to inspect the type of the value being returned. Please open a GitHub issue for that. At the top of my head I have no idea how hard or easy this is to implement. -- Alex From adrianslowikowski66 at gmail.com Thu Apr 19 15:14:01 2018 From: adrianslowikowski66 at gmail.com (Margaret Slowikowska) Date: Thu, 19 Apr 2018 20:14:01 +0100 Subject: [code-quality] [feature request] Unused variable warning for "except Exception as e" Message-ID: <67A23B17-9BB7-4EB7-9499-2ECD936BECF4@gmail.com> Sent from my iPhone From carlospecter at gmail.com Fri Apr 20 17:31:47 2018 From: carlospecter at gmail.com (=?UTF-8?Q?Carlos_Co=C3=AAlho?=) Date: Fri, 20 Apr 2018 21:31:47 +0000 Subject: [code-quality] Some other additions to PyCQA possibly In-Reply-To: References: <183aaf41-82df-4dd0-8f39-a9638c07eca7@getmailbird.com> Message-ID: Awesome Carl! Are there any plans on opening new spots for prospector maintainers? On Fri, Apr 6, 2018 at 8:24 PM Ian Stapleton Cordasco < graffatcolmingov at gmail.com> wrote: > Woot!!! > > On Fri, Apr 6, 2018 at 5:37 PM, Carl Crowder > wrote: > > Hi there, > > > > Finally got around to moving this. Since it's so tightly tied to > > Landscape.io I wasn't quite sure the best way to do it but that project > is > > EOL really. Finally made the leap. > > > > Prospector is now under PyCQA. > > > > Cheers, > > Carl > > > > On 22/03/2018 01:48:06, Carlos Co?lho wrote: > > > > Any news on moving prospector to PyCQA? > > > > Em 8 de mar de 2018, ?(s) 21:06, Carl Crowder > > escreveu: > > > > I would say that the motivation of pylint-plugin-utils was twofold: > > > > First - it was a bit of a pain to try to figure out how to write a > plugin. > > This was about 5 years ago though so not sure if that is still true but > it > > took me a while to figure out. Docs on that could be better. > > > > Second - it was really just a utility to make it easier to do several > things > > which were useful, such as ?skip this error in this context? or ?add this > > error in this context?. > > > > I definitely think the plugin API in pylint could be easier to use, I?m > not > > sure if pylint-plugin-utils is the answer because it?s just a bandaid > > really. It could be useful to see the symptoms it was trying to solve > > though. > > > > Carl > > > > > > On 8 March 2018 at 21:51:29, Ashley Whetter (ashley at awhetter.co.uk) > wrote: > > > > Does it make more sense to try and merge pylint plugin utils into pylint > > core? > > If the plugin interface is clunky enough on its own that there exists > > utilities for creating plugins, then I think that's an issue that we > need to > > look at resolving. > > I've been taking a look at this repository recently for the per directory > > config project in pylint to get sense of how the plugin interface is > being > > used and getting ideas for the kind of thing that we should be aiming > for. > > > > Ashley > > > > _______________________________________________ > > code-quality mailing list > > code-quality at python.org > > https://mail.python.org/mailman/listinfo/code-quality > > > > > > _______________________________________________ > > code-quality mailing list > > code-quality at python.org > > https://mail.python.org/mailman/listinfo/code-quality > > > -- *Carlos Co?lho* Software Developer Hangout: carlos at vinta.com.br Skype: carloshf.oliveira We design, develop and fix beautiful software. *http://www.vinta.com.br/ * -------------- next part -------------- An HTML attachment was scrubbed... URL: From carl.crowder at gmail.com Sat Apr 21 04:21:01 2018 From: carl.crowder at gmail.com (Carl Crowder) Date: Sat, 21 Apr 2018 10:21:01 +0200 Subject: [code-quality] Some other additions to PyCQA possibly In-Reply-To: References: <183aaf41-82df-4dd0-8f39-a9638c07eca7@getmailbird.com> Message-ID: <25bab2f8-bff7-4fdf-9eb4-d78286a72e06@getmailbird.com> Hi Carlos, I am definitely keen to add more maintainers. If you are interested - and the same is true for anyone on this list - just drop me an email and we can discuss :-) Carl On 20/04/2018 23:31:59, Carlos Co?lho wrote: Awesome Carl! Are there any plans on opening new spots for prospector maintainers? On Fri, Apr 6, 2018 at 8:24 PM Ian Stapleton Cordasco wrote: Woot!!! On Fri, Apr 6, 2018 at 5:37 PM, Carl Crowder wrote: > Hi there, > > Finally got around to moving this. Since it's so tightly tied to > Landscape.io I wasn't quite sure the best way to do it but that project is > EOL really. Finally made the leap. > > Prospector is now under PyCQA. > > Cheers, > Carl > > On 22/03/2018 01:48:06, Carlos Co?lho wrote: > > Any news on moving prospector to PyCQA? > > Em 8 de mar de 2018, ?(s) 21:06, Carl Crowder > escreveu: > > I would say that the motivation of pylint-plugin-utils was twofold: > > First - it was a bit of a pain to try to figure out how to write a plugin. > This was about 5 years ago though so not sure if that is still true but it > took me a while to figure out. Docs on that could be better. > > Second - it was really just a utility to make it easier to do several things > which were useful, such as ?skip this error in this context? or ?add this > error in this context?. > > I definitely think the plugin API in pylint could be easier to use, I?m not > sure if pylint-plugin-utils is the answer because it?s just a bandaid > really. It could be useful to see the symptoms it was trying to solve > though. > > Carl > > > On 8 March 2018 at 21:51:29, Ashley Whetter (ashley at awhetter.co.uk [mailto:ashley at awhetter.co.uk]) wrote: > > Does it make more sense to try and merge pylint plugin utils into pylint > core? > If the plugin interface is clunky enough on its own that there exists > utilities for creating plugins, then I think that's an issue that we need to > look at resolving. > I've been taking a look at this repository recently for the per directory > config project in pylint to get sense of how the plugin interface is being > used and getting ideas for the kind of thing that we should be aiming for. > > Ashley > > _______________________________________________ > code-quality mailing list > code-quality at python.org [mailto:code-quality at python.org] > https://mail.python.org/mailman/listinfo/code-quality [https://mail.python.org/mailman/listinfo/code-quality] > > > _______________________________________________ > code-quality mailing list > code-quality at python.org [mailto:code-quality at python.org] > https://mail.python.org/mailman/listinfo/code-quality [https://mail.python.org/mailman/listinfo/code-quality] > -- Carlos Co?lho Software Developer Hangout: carlos at vinta.com.br [mailto:carlos at vinta.com.br] Skype: carloshf.oliveira We design, develop and fix beautiful software. http://www.vinta.com.br/ [http://www.vinta.com.br/] -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.mcdowall at gmail.com Tue Apr 24 04:38:20 2018 From: mark.mcdowall at gmail.com (Mark McDowall) Date: Tue, 24 Apr 2018 09:38:20 +0100 Subject: [code-quality] C0326 not picking up whitespace before open bracket with print Message-ID: Hi, While using pylint I have found that having a space between 'print' and the open bracket is allowed. Based on the PEP8 pet peeves I would have assumed that 'print ("hello!")' would have raised the C0326 warning. Is there a reason why this is not the case? I can't seem to find a post anywhere talking about allowing this. Thank you, Mark -------------- next part -------------- An HTML attachment was scrubbed... URL: From jwilk at jwilk.net Wed Apr 25 06:10:11 2018 From: jwilk at jwilk.net (Jakub Wilk) Date: Wed, 25 Apr 2018 12:10:11 +0200 Subject: [code-quality] C0326 not picking up whitespace before open bracket with print In-Reply-To: References: Message-ID: <20180425101011.xa3xkmkeuwtghbxo@jwilk.net> * Mark McDowall , 2018-04-24, 09:38: >Based on the PEP8 pet peeves I would have assumed that 'print >("hello!")' would have raised the C0326 warning. > >Is there a reason why this is not the case? I tested with Pylint 1.8.4 + astroid 1.6.3. With Python 3.6, I actually do get a warning, as expected: C: 1, 0: No space allowed before bracket print ("hello!") ^ (bad-whitespace) With Python 2.7, I don't get any warning. But again, this is expected, because print isn't a function in Python 2. One could even argue that Pylint should warn when the space after "print" is missing. Now, if you're using "from __future__ import print_function", then print is a function, even in Python 2. Pylint doesn't emit the warning in this case, which I think is a bug. -- Jakub Wilk