Especially when writing test fakes for 3rd-party code like pyOpenSSL, I need to type _ in an identifier in a place twistedchecker doesn't like it. We should have a way to quash this warning, at least.
Maybe we can relax this rule in files from the test suite.
I prefer this generic exception, rather than having to add an ignore markup each time the exception is break.
I agree that a generic exception would be better. I suppose we could start by relaxing it in test modules and see how many spurious failures remain...
Related: #82 #77
Hit this on http://twistedmatrix.com/trac/ticket/4804
#82 #77 are for attribute names ... not for methods
Can you please provide an example code which fails?
I tried the following code on master and it does not complain about get_context() method
Test helpers implementing / faking external interfaces are excepted
from Twisted coding standard
Right now it rejects
but this is accepted
For the case when pyOpenSSL mocks are implemented, I would say that they can be muted using something like # pylint: disable=C0103
# pylint: disable=C0103
For the global_tcpip_forward we have add some hints to the code so that the linter will know how to handle these methods.
def gotGlobalRequest(self, requestType, data):
# XXX should this use method dispatch?
requestType = requestType.replace('-', '_')
f = getattr(self, "global_%s" % requestType, None)
if not f:
the decorator could set up a _protocolDispatchers = ['global'] variable and the the linter can check that methods starting with this can have underlines.
_protocolDispatchers = ['global']