On Tue, Dec 19, 2017 at 11:13 AM, Raphael Hertzog <hert...@debian.org> wrote:
> On Mon, 18 Dec 2017, Ville Skyttä wrote:
>> -exclude = 
>> .git,.ropeproject,__pycache__,distro_tracker/project/settings/local.py,*/migrations/*.py
>> +exclude = 
>> .git,.ropeproject,.tox,__pycache__,distro_tracker/project/settings/local.py,distro_tracker/vendor,docs/conf.py,*/migrations/*.py
>
> Ok, for .tox and docs/conf.py. But why distro_tracker/vendor?

Without having had a closer look, I assumed that the vendor dir is for
"vendored" packages, i.e. bundled ones from other upstreams, but that
seems wrong. Updated patch attached.

> And why is it needed at all? I was not getting any warning from those
> directories (I see a few errors currently with the latest version of
> flake8, but not specially in the above directories).

I see a bunch of errors related to use of bare except there. Full list
attached, generated with:
$ flake8 --version
3.5.0 (flake8-bugbear: 17.12.0, mccabe: 0.6.1, pycodestyle: 2.3.1,
pyflakes: 1.6.0) CPython 3.6.3 on Linux
./setup.py:9:1: E302 expected 2 blank lines, found 1
./setup.py:12:22: E225 missing whitespace around operator
./setup.py:42:81: E501 line too long (81 > 80 characters)
./setup.py:47:9: E121 continuation line under-indented for hanging indent
./setup.py:52:6: E124 closing bracket does not match visual indentation
./setup.py:60:9: E121 continuation line under-indented for hanging indent
./setup.py:65:6: E124 closing bracket does not match visual indentation
./manage.py:17:81: E501 line too long (86 > 80 characters)
./distro_tracker/accounts/views.py:194:36: B306 `BaseException.message` has 
been deprecated as of Python 2.6 and is removed in Python 3. Use `str(e)` to 
access the user-readable message. Use `e.args` to access arguments passed to 
the exception.
./distro_tracker/core/panels.py:727:13: E722 do not use bare except'
./distro_tracker/core/panels.py:727:13: B001 Do not use bare `except:`, it also 
catches unexpected events like memory errors, interrupts, system exit, and so 
on.  Prefer `except Exception:`.  If you're sure what you're doing, be explicit 
and write `except BaseException:`.
./distro_tracker/core/retrieve_data.py:60:5: E722 do not use bare except'
./distro_tracker/core/retrieve_data.py:60:5: B001 Do not use bare `except:`, it 
also catches unexpected events like memory errors, interrupts, system exit, and 
so on.  Prefer `except Exception:`.  If you're sure what you're doing, be 
explicit and write `except BaseException:`.
./distro_tracker/core/admin.py:73:5: E722 do not use bare except'
./distro_tracker/core/admin.py:73:5: B001 Do not use bare `except:`, it also 
catches unexpected events like memory errors, interrupts, system exit, and so 
on.  Prefer `except Exception:`.  If you're sure what you're doing, be explicit 
and write `except BaseException:`.
./distro_tracker/core/models.py:2021:9: E722 do not use bare except'
./distro_tracker/core/models.py:2021:9: B001 Do not use bare `except:`, it also 
catches unexpected events like memory errors, interrupts, system exit, and so 
on.  Prefer `except Exception:`.  If you're sure what you're doing, be explicit 
and write `except BaseException:`.
./distro_tracker/core/management/commands/tracker_run_task.py:56:13: E722 do 
not use bare except'
./distro_tracker/core/management/commands/tracker_run_task.py:56:13: B001 Do 
not use bare `except:`, it also catches unexpected events like memory errors, 
interrupts, system exit, and so on.  Prefer `except Exception:`.  If you're 
sure what you're doing, be explicit and write `except BaseException:`.
./distro_tracker/core/tests/tests_utils.py:599:9: E741 ambiguous variable name 
'l'
./distro_tracker/core/tests/tests_utils.py:602:9: E741 ambiguous variable name 
'l'
./distro_tracker/core/tests/tests_utils.py:605:9: E741 ambiguous variable name 
'l'
./distro_tracker/core/tests/tests_utils.py:612:9: E741 ambiguous variable name 
'l'
./distro_tracker/core/tests/tests_utils.py:630:25: E741 ambiguous variable name 
'l'
./distro_tracker/core/tests/tests_utils.py:632:26: E741 ambiguous variable name 
'l'
./distro_tracker/core/tests/tests_utils.py:634:25: E741 ambiguous variable name 
'l'
./distro_tracker/core/tests/tests_utils.py:635:26: E741 ambiguous variable name 
'l'
./distro_tracker/core/tests/tests_utils.py:668:9: E741 ambiguous variable name 
'l'
./distro_tracker/core/tests/tests_models.py:127:9: E741 ambiguous variable name 
'l'
./distro_tracker/core/tests/tests_models.py:128:9: E741 ambiguous variable name 
'l'
./distro_tracker/core/tests/tests_models.py:139:9: E741 ambiguous variable name 
'l'
./distro_tracker/core/utils/__init__.py:97:24: E741 ambiguous variable name 'l'
./distro_tracker/core/utils/http.py:225:9: E722 do not use bare except'
./distro_tracker/core/utils/http.py:225:9: B001 Do not use bare `except:`, it 
also catches unexpected events like memory errors, interrupts, system exit, and 
so on.  Prefer `except Exception:`.  If you're sure what you're doing, be 
explicit and write `except BaseException:`.
./distro_tracker/core/utils/packages.py:214:22: B007 Loop control variable 
'dirnames' not used within the loop body. If this is intended, start the name 
with an underscore.
./distro_tracker/extract_source_files/tracker_tasks.py:121:17: E722 do not use 
bare except'
./distro_tracker/extract_source_files/tracker_tasks.py:121:17: B001 Do not use 
bare `except:`, it also catches unexpected events like memory errors, 
interrupts, system exit, and so on.  Prefer `except Exception:`.  If you're 
sure what you're doing, be explicit and write `except BaseException:`.
./distro_tracker/extract_source_files/tracker_tasks.py:143:13: E722 do not use 
bare except'
./distro_tracker/extract_source_files/tracker_tasks.py:143:13: B001 Do not use 
bare `except:`, it also catches unexpected events like memory errors, 
interrupts, system exit, and so on.  Prefer `except Exception:`.  If you're 
sure what you're doing, be explicit and write `except BaseException:`.
./distro_tracker/mail/control/commands/base.py:47:5: B303 `__metaclass__` does 
nothing on Python 3. Use `class MyClass(BaseClass, metaclass=...)`. For Python 
2 compatibility, use `six.add_metaclass`.
./distro_tracker/mail/control/commands/misc.py:101:23: B306 
`BaseException.message` has been deprecated as of Python 2.6 and is removed in 
Python 3. Use `str(e)` to access the user-readable message. Use `e.args` to 
access arguments passed to the exception.
./distro_tracker/mail/tests/tests_processor.py:704:13: B007 Loop control 
variable 'i' not used within the loop body. If this is intended, start the name 
with an underscore.
./distro_tracker/mail/tests/tests_processor.py:730:13: B007 Loop control 
variable 'i' not used within the loop body. If this is intended, start the name 
with an underscore.
./distro_tracker/vendor/debian/tests.py:2327:48: B006 Do not use mutable data 
structures for argument defaults. All calls reuse one instance of that data 
structure, persisting changes between them.
./distro_tracker/vendor/debian/tracker_panels.py:78:9: E722 do not use bare 
except'
./distro_tracker/vendor/debian/tracker_panels.py:78:9: B001 Do not use bare 
`except:`, it also catches unexpected events like memory errors, interrupts, 
system exit, and so on.  Prefer `except Exception:`.  If you're sure what 
you're doing, be explicit and write `except BaseException:`.
./distro_tracker/vendor/debian/tracker_tasks.py:459:9: E722 do not use bare 
except'
./distro_tracker/vendor/debian/tracker_tasks.py:459:9: B001 Do not use bare 
`except:`, it also catches unexpected events like memory errors, interrupts, 
system exit, and so on.  Prefer `except Exception:`.  If you're sure what 
you're doing, be explicit and write `except BaseException:`.
./distro_tracker/vendor/debian/tracker_tasks.py:466:9: E722 do not use bare 
except'
./distro_tracker/vendor/debian/tracker_tasks.py:466:9: B001 Do not use bare 
`except:`, it also catches unexpected events like memory errors, interrupts, 
system exit, and so on.  Prefer `except Exception:`.  If you're sure what 
you're doing, be explicit and write `except BaseException:`.
./distro_tracker/vendor/debian/tracker_tasks.py:1780:13: E722 do not use bare 
except'
./distro_tracker/vendor/debian/tracker_tasks.py:1780:13: B001 Do not use bare 
`except:`, it also catches unexpected events like memory errors, interrupts, 
system exit, and so on.  Prefer `except Exception:`.  If you're sure what 
you're doing, be explicit and write `except BaseException:`.
./distro_tracker/vendor/debian/tracker_tasks.py:1815:9: E722 do not use bare 
except'
./distro_tracker/vendor/debian/tracker_tasks.py:1815:9: B001 Do not use bare 
`except:`, it also catches unexpected events like memory errors, interrupts, 
system exit, and so on.  Prefer `except Exception:`.  If you're sure what 
you're doing, be explicit and write `except BaseException:`.
./distro_tracker/vendor/debian/management/commands/tracker_import_old_news.py:85:13:
 E722 do not use bare except'
./distro_tracker/vendor/debian/management/commands/tracker_import_old_news.py:85:13:
 B001 Do not use bare `except:`, it also catches unexpected events like memory 
errors, interrupts, system exit, and so on.  Prefer `except Exception:`.  If 
you're sure what you're doing, be explicit and write `except BaseException:`.
./distro_tracker/vendor/debian/management/commands/tracker_import_old_subscriber_dump.py:41:13:
 E722 do not use bare except'
./distro_tracker/vendor/debian/management/commands/tracker_import_old_subscriber_dump.py:41:13:
 B001 Do not use bare `except:`, it also catches unexpected events like memory 
errors, interrupts, system exit, and so on.  Prefer `except Exception:`.  If 
you're sure what you're doing, be explicit and write `except BaseException:`.
From d564b0067637fd1f3abc34a7a28980b6544b5b44 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ville=20Skytt=C3=A4?= <ville.sky...@iki.fi>
Date: Mon, 18 Dec 2017 18:05:38 +0200
Subject: [PATCH] Exclude .tox and docs/conf.py from flake8

---
 tox.ini | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tox.ini b/tox.ini
index b8da0bd..b563afc 100644
--- a/tox.ini
+++ b/tox.ini
@@ -57,7 +57,7 @@ deps =
 [flake8]
 max-complexity = 12
 max-line-length = 80
-exclude = .git,.ropeproject,__pycache__,distro_tracker/project/settings/local.py,*/migrations/*.py
+exclude = .git,.ropeproject,.tox,__pycache__,distro_tracker/project/settings/local.py,docs/conf.py,*/migrations/*.py
 ignore = N813,N806,N802
 
 [testenv:coverage]
-- 
2.14.1

Reply via email to