Add flake8 linting.
Loading
Created by: tomprince
Here are the issues that were reported by flake8, along with some comments on how I addressed them where appropriate.
E402 module level import not at top of file
This was cause by some code calling registerAdapter
on ZKAPAuthorizerStorageServer
. It looks like that was needed because the interfaces for it were defined by implementer_only
which explicitly ignored interfaces defined by parent classes. Looking at the history, I assume the use of implementer_only
was to avoid implementing RIStorageServer
via proxyForInterface
. Given that the later is no longer used, implementer_only
is no longer necessary.
Reading some documentation, I think an alternative to needing to having the registerAdapter
would have been to use
-@implementer_only(RIPrivacyPassAuthorizedStorageServer, IReferenceable, IRemotelyCallable)
+@implementer_only(RIPrivacyPassAuthorizedStorageServer, implementedBy(Referenceable))
E722 do not use bare 'except'
These were replaced by except Exception:
E302 expected 2 blank lines, found 1
E501 line too long These are the changes I'm least sure of. I did a variety of things for this
lambda
with a bunch of parameters. Here I changed the order of agruments, and converted the lambda to use partial
instead.# noqa: E501
E731 do not assign a lambda expression, use a def
*/tests/*.py
.