From jaimem at energysavvy.com Tue Nov 8 19:27:38 2016 From: jaimem at energysavvy.com (Jaime McCandless) Date: Wed, 09 Nov 2016 00:27:38 +0000 Subject: [code-quality] flake8 3.0 no longer excludes .tox Message-ID: I upgraded from flake8 2.5.4 to 3.0.4 and my .tox directory was no longer excluded by default. I didn't find any documentation on this change. It would be great if you either: - fixed this (i.e. exclude .tox by default) - documented the breaking change Jaime -------------- next part -------------- An HTML attachment was scrubbed... URL: From graffatcolmingov at gmail.com Tue Nov 8 20:52:29 2016 From: graffatcolmingov at gmail.com (Ian Cordasco) Date: Tue, 8 Nov 2016 19:52:29 -0600 Subject: [code-quality] flake8 3.0 no longer excludes .tox In-Reply-To: References: Message-ID: On Tue, Nov 8, 2016 at 6:27 PM, Jaime McCandless wrote: > I upgraded from flake8 2.5.4 to 3.0.4 and my .tox directory was no longer > excluded by default. I didn't find any documentation on this change. > > It would be great if you either: > > fixed this (i.e. exclude .tox by default) > documented the breaking change > > Jaime Hi Jaime, I can't reproduce this. It'd be great if you could provide more detail. You can see the bug report template on GitLab for the kind of detail we request of people reporting bugs. From peter.bittner at gmx.net Wed Nov 9 04:35:27 2016 From: peter.bittner at gmx.net (Peter Bittner) Date: Wed, 9 Nov 2016 10:35:27 +0100 Subject: [code-quality] flake8 3.0 no longer excludes .tox In-Reply-To: References: Message-ID: Hi there, I can confirm this behavior. Took me by surprise in the middle of September when I started a project where I use Tox to run even static code analysis. I wasn't sure though whether it was always like this. Now I know better---thanks for the confirmation, Jaime. I had to exclude .tox through my flake8 configuration like this: https://github.com/painless-software/painless-continuous-delivery/blob/master/tox.ini#L36 Cheers, Peter 2016-11-09 2:52 GMT+01:00 Ian Cordasco: > On Tue, Nov 8, 2016 at 6:27 PM, Jaime McCandless wrote: >> I upgraded from flake8 2.5.4 to 3.0.4 and my .tox directory was no longer >> excluded by default. I didn't find any documentation on this change. >> >> It would be great if you either: >> >> fixed this (i.e. exclude .tox by default) >> documented the breaking change >> >> Jaime > > Hi Jaime, > > I can't reproduce this. It'd be great if you could provide more > detail. You can see the bug report template on GitLab for the kind of > detail we request of people reporting bugs. From jaimem at energysavvy.com Wed Nov 9 12:55:26 2016 From: jaimem at energysavvy.com (Jaime McCandless) Date: Wed, 09 Nov 2016 17:55:26 +0000 Subject: [code-quality] flake8 3.0 no longer excludes .tox In-Reply-To: References: Message-ID: Yes, I was able to work around the issue by updating my flake8 config, but I would have preferred no breaking change or documentation on the change. I didn't realize I could log in to gitlab to be able to submit an issue. I created a login and wrote up the bug: https://gitlab.com/pycqa/flake8/issues/250 On Wed, Nov 9, 2016 at 1:36 AM Peter Bittner wrote: Hi there, I can confirm this behavior. Took me by surprise in the middle of September when I started a project where I use Tox to run even static code analysis. I wasn't sure though whether it was always like this. Now I know better---thanks for the confirmation, Jaime. I had to exclude .tox through my flake8 configuration like this: https://github.com/painless-software/painless-continuous-delivery/blob/master/tox.ini#L36 Cheers, Peter 2016-11-09 2:52 GMT+01:00 Ian Cordasco: > On Tue, Nov 8, 2016 at 6:27 PM, Jaime McCandless wrote: >> I upgraded from flake8 2.5.4 to 3.0.4 and my .tox directory was no longer >> excluded by default. I didn't find any documentation on this change. >> >> It would be great if you either: >> >> fixed this (i.e. exclude .tox by default) >> documented the breaking change >> >> Jaime > > Hi Jaime, > > I can't reproduce this. It'd be great if you could provide more > detail. You can see the bug report template on GitLab for the kind of > detail we request of people reporting bugs. -------------- next part -------------- An HTML attachment was scrubbed... URL: From peter.bittner at gmx.net Wed Nov 9 15:20:18 2016 From: peter.bittner at gmx.net (Peter Bittner) Date: Wed, 9 Nov 2016 21:20:18 +0100 Subject: [code-quality] flake8 3.0 no longer excludes .tox In-Reply-To: References: Message-ID: Sorry Jaime, I didn't mean to make a suggestion. > Yes, I was able to work around the issue by updating my flake8 config, but I > would have preferred no breaking change or documentation on the change. ... I just wanted to describe what I, personally, _had_ to do to work around the issue. And I fully agree with you. Peter From barry at python.org Thu Nov 10 09:14:12 2016 From: barry at python.org (Barry Warsaw) Date: Thu, 10 Nov 2016 09:14:12 -0500 Subject: [code-quality] flake8 3.0 no longer excludes .tox References: Message-ID: <20161110091412.2276b0d8@presto.wooz.org> On Nov 09, 2016, at 09:20 PM, Peter Bittner wrote: >... I just wanted to describe what I, personally, _had_ to do to work >around the issue. And I fully agree with you. Interesting. I haven't seen this because I generally invoke flake8 with an explicit directory that's usually a sibling of .tox, e.g.: [testenv:qa] basepython = python3 commands = python -m flake8 src Cheers, -Barry -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 801 bytes Desc: OpenPGP digital signature URL: From graffatcolmingov at gmail.com Thu Nov 10 09:44:54 2016 From: graffatcolmingov at gmail.com (Ian Cordasco) Date: Thu, 10 Nov 2016 08:44:54 -0600 Subject: [code-quality] flake8 3.0 no longer excludes .tox In-Reply-To: <20161110091412.2276b0d8@presto.wooz.org> References: <20161110091412.2276b0d8@presto.wooz.org> Message-ID: On Thu, Nov 10, 2016 at 8:14 AM, Barry Warsaw wrote: > On Nov 09, 2016, at 09:20 PM, Peter Bittner wrote: > >>... I just wanted to describe what I, personally, _had_ to do to work >>around the issue. And I fully agree with you. > > Interesting. I haven't seen this because I generally invoke flake8 with an > explicit directory that's usually a sibling of .tox, e.g.: > > [testenv:qa] > basepython = python3 > commands = > python -m flake8 src > > Cheers, > -Barry Either way, I've added it to the release notes for 3.0: https://gitlab.com/pycqa/flake8/merge_requests/139. I usually dislike editing the notes for a released version, but this is important and hopefully that note will suffice as an apology. ;) Cheers, Ian From graffatcolmingov at gmail.com Sat Nov 12 15:56:46 2016 From: graffatcolmingov at gmail.com (Ian Cordasco) Date: Sat, 12 Nov 2016 14:56:46 -0600 Subject: [code-quality] Flake8 3.1.0b1 Tagged Message-ID: Hi all, I've tagged (not released to PyPI) 3.1.0b1 of Flake8. It includes a number of bug fixes: http://flake8.pycqa.org/en/latest/release-notes/3.1.0.html If no one finds anything wrong with it, I'll be releasing it on Monday the 14th. Cheers! Ian From liam.stewart at gmail.com Tue Nov 15 18:12:08 2016 From: liam.stewart at gmail.com (Liam Stewart) Date: Tue, 15 Nov 2016 17:12:08 -0600 Subject: [code-quality] flake8 organization configuration Message-ID: We have multiple python projects over multiple (private) repos in github and I would like all of them to share a standard, organization-wide style (eg. line length, any explicit select/ignore settings, etc.). Each individual project could have a configuration that contained project-specific settings. This would normally be additional ignore settings (eg. to gradually transition a project to our style rule by rule). Ideally, a developer should be able to run a single command to do style checks. I'm looking for guidance about how to go about doing this with flake8. What I was thinking was that we'd have a private python package that brings in flake8 plus any plugin packages and custom extensions (similar to hacking); it would also bring in the global configuration file. In this way, projects could simply add, say, -flake8 to their requirements.txt file. I'm pretty sure that we'd need a wrapper script to handle the global configuration. The question is more about how to specify the global config correctly. flake8's doesn't seem to have the notion of a global base configuration; the closest thing is the user configuration, but that is layered on top of whatever project configuration there is. The "--config" argument isn't useful as that forces a single configuration file. "--append-config" is a possibility. A wrapper that runs flake8 with --append-config to layer first global + local could work but local settings would have to be in a fixed file. We'd layer local-global-local. That's sort of ok, but would lead to surprising results if a dev put settings in say "setup.cfg" and the wrapper always tried ".flake8" (though we could minimize such surprises by specifying all known project file names..). Is there another way to go about this that I haven't considered? Would it be reasonable to add a "--prepend-config" argument? In which case the layering order would be prepend, local files, append, user. (Happy to submit a PR or whatever the gitlab equivalent is.) Thanks, liam -- Liam Stewart :: liam.stewart at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jamesbroadhead at gmail.com Wed Nov 16 09:45:36 2016 From: jamesbroadhead at gmail.com (James Broadhead) Date: Wed, 16 Nov 2016 14:45:36 +0000 Subject: [code-quality] flake8 organization configuration In-Reply-To: References: Message-ID: I'd recommend that you consider an auto-formatter over a style-linter - such as yapf or autopep8 - and have the auto-formatting applied as a pre-commit step (and validated in tests, or on CI) Autoformatters reduce the burden of conformance on developers, avoid mixed style-and-feature-change patches, and moves the focus of code-review towards the intended changes and away from nit-picking. All together, they remove complexity for those new to a project. One discussion on the subject -- there are many others, especially from people who've programmed some Go, where auto-formatting is mandatory. https://groups.google.com/forum/#!topic/python-ideas/xute5NmXRps On 15 November 2016 at 23:12, Liam Stewart wrote: > > We have multiple python projects over multiple (private) repos in github > and I would like all of them to share a standard, organization-wide style > (eg. line length, any explicit select/ignore settings, etc.). Each > individual project could have a configuration that contained > project-specific settings. This would normally be additional ignore > settings (eg. to gradually transition a project to our style rule by rule). > Ideally, a developer should be able to run a single command to do style > checks. > > I'm looking for guidance about how to go about doing this with flake8. > What I was thinking was that we'd have a private python package that brings > in flake8 plus any plugin packages and custom extensions (similar to > hacking); it would also bring in the global configuration file. In this > way, projects could simply add, say, -flake8 to their requirements.txt > file. I'm pretty sure that we'd need a wrapper script to handle the global > configuration. The question is more about how to specify the global config > correctly. > > flake8's doesn't seem to have the notion of a global base configuration; > the closest thing is the user configuration, but that is layered on top of > whatever project configuration there is. The "--config" argument isn't > useful as that forces a single configuration file. "--append-config" is a > possibility. A wrapper that runs flake8 with --append-config to layer first > global + local could work but local settings would have to be in a fixed > file. We'd layer local-global-local. That's sort of ok, but would lead to > surprising results if a dev put settings in say "setup.cfg" and the wrapper > always tried ".flake8" (though we could minimize such surprises by > specifying all known project file names..). > > Is there another way to go about this that I haven't considered? Would it > be reasonable to add a "--prepend-config" argument? In which case the > layering order would be prepend, local files, append, user. (Happy to > submit a PR or whatever the gitlab equivalent is.) > > Thanks, > > liam > > -- > Liam Stewart :: liam.stewart at gmail.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 francesc.elies at gmail.com Wed Nov 23 10:08:03 2016 From: francesc.elies at gmail.com (Francesc Elies Henar) Date: Wed, 23 Nov 2016 16:08:03 +0100 Subject: [code-quality] RuntimeError: dictionary changed size during iteration Message-ID: <71569ca8-eede-c086-4f51-6d892b8c17c2@gmail.com> Hi On circle ci when I run flake I get the following error, but when I run it locally everything runs smoothly and I am uncapable of reprducing it, but somehow on circle ci fails. Does anyone have an idea what it could be the issue, see Error below Thanks in advance for any hints and your time. Best, Farncesc The error: flake8 --ignore=E712 background_tasks Traceback (most recent call last): File "/home/ubuntu/virtualenvs/venv-3.5.1/bin/flake8", line 5, in main() File "/home/ubuntu/virtualenvs/venv-3.5.1/lib/python3.5/site-packages/flake8/run.py", line 48, in main options, args = pep8.process_options() File "/home/ubuntu/virtualenvs/venv-3.5.1/lib/python3.5/site-packages/flake8/pep8.py", line 1343, in process_options options.physical_checks = find_checks('physical_line') File "/home/ubuntu/virtualenvs/venv-3.5.1/lib/python3.5/site-packages/flake8/pep8.py", line 812, in find_checks for name, function in globals().items(): RuntimeError: dictionary changed size during iteration -------------- next part -------------- An HTML attachment was scrubbed... URL: From jacob.scott at gmail.com Wed Nov 23 13:45:01 2016 From: jacob.scott at gmail.com (Jacob Scott) Date: Wed, 23 Nov 2016 10:45:01 -0800 Subject: [code-quality] Flake8 / W291 in comments Message-ID: Hi code quality folks, I'd like to use flake8 to enforce no trailing whitespace, except in comments. Is there a way to do this? My main use case is to have compatibility with autopep8, which does not remove trailing whitespace from comments. Thanks, Jacob -------------- next part -------------- An HTML attachment was scrubbed... URL: From jacob.scott at gmail.com Wed Nov 23 14:05:03 2016 From: jacob.scott at gmail.com (Jacob Scott) Date: Wed, 23 Nov 2016 11:05:03 -0800 Subject: [code-quality] Flake8 / W291 in comments In-Reply-To: References: Message-ID: I actually think my questions may be covered in https://github.com/PyCQA/pycodestyle/issues/45 -- sorry On Wed, Nov 23, 2016 at 10:45 AM, Jacob Scott wrote: > Hi code quality folks, > > I'd like to use flake8 to enforce no trailing whitespace, except in > comments. Is there a way to do this? My main use case is to have > compatibility with autopep8, which does not remove trailing whitespace from > comments. > > Thanks, > > Jacob > -------------- next part -------------- An HTML attachment was scrubbed... URL: