mirror of
https://github.com/certbot/certbot.git
synced 2026-06-08 08:12:15 -04:00
Disable pylint invalid-name
It's clearly making our code harder to read and write
This commit is contained in:
parent
1e3c92c714
commit
2a3a111d62
18 changed files with 29 additions and 29 deletions
|
|
@ -38,7 +38,7 @@ load-plugins=linter_plugin
|
|||
# --enable=similarities". If you want to run only the classes checker, but have
|
||||
# no Warning level messages displayed, use"--disable=all --enable=classes
|
||||
# --disable=W"
|
||||
disable=fixme,locally-disabled,abstract-class-not-used,bad-continuation,too-few-public-methods,no-self-use
|
||||
disable=fixme,locally-disabled,abstract-class-not-used,bad-continuation,too-few-public-methods,no-self-use,invalid-name
|
||||
# abstract-class-not-used cannot be disabled locally (at least in pylint 1.4.1)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -315,7 +315,7 @@ class DVSNIResponse(ChallengeResponse):
|
|||
validation = jose.Field("validation", decoder=jose.JWS.from_json)
|
||||
|
||||
@property
|
||||
def z(self): # pylint: disable=invalid-name
|
||||
def z(self):
|
||||
"""The ``z`` parameter.
|
||||
|
||||
:rtype: bytes
|
||||
|
|
@ -333,7 +333,7 @@ class DVSNIResponse(ChallengeResponse):
|
|||
:rtype: bytes
|
||||
|
||||
"""
|
||||
z = self.z # pylint: disable=invalid-name
|
||||
z = self.z
|
||||
return z[:32] + b'.' + z[32:] + self.DOMAIN_SUFFIX
|
||||
|
||||
@property
|
||||
|
|
|
|||
|
|
@ -269,7 +269,7 @@ class DVSNIResponseTest(unittest.TestCase):
|
|||
'validation': self.validation.to_json(),
|
||||
}
|
||||
|
||||
# pylint: disable=invalid-name
|
||||
|
||||
label1 = b'e2df3498860637c667fedadc5a8494ec'
|
||||
label2 = b'09dcc75553c9b3bd73662b50e71b1e42'
|
||||
self.z = label1 + label2
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ class JSONDeSerializableTest(unittest.TestCase):
|
|||
def setUp(self):
|
||||
from acme.jose.interfaces import JSONDeSerializable
|
||||
|
||||
# pylint: disable=missing-docstring,invalid-name
|
||||
# pylint: disable=missing-docstring
|
||||
|
||||
class Basic(JSONDeSerializable):
|
||||
def __init__(self, v):
|
||||
|
|
@ -53,7 +53,7 @@ class JSONDeSerializableTest(unittest.TestCase):
|
|||
self.nested = Basic([[self.basic1]])
|
||||
self.tuple = Basic(('foo',))
|
||||
|
||||
# pylint: disable=invalid-name
|
||||
|
||||
self.Basic = Basic
|
||||
self.Sequence = Sequence
|
||||
self.Mapping = Mapping
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ class JSONObjectWithFieldsMetaTest(unittest.TestCase):
|
|||
from acme.jose.json_util import JSONObjectWithFieldsMeta
|
||||
self.field = Field('Baz')
|
||||
self.field2 = Field('Baz2')
|
||||
# pylint: disable=invalid-name,missing-docstring,too-few-public-methods
|
||||
# pylint: disable=missing-docstring,too-few-public-methods
|
||||
# pylint: disable=blacklisted-name
|
||||
|
||||
@six.add_metaclass(JSONObjectWithFieldsMeta)
|
||||
|
|
@ -138,7 +138,7 @@ class JSONObjectWithFieldsTest(unittest.TestCase):
|
|||
from acme.jose.json_util import Field
|
||||
|
||||
class MockJSONObjectWithFields(JSONObjectWithFields):
|
||||
# pylint: disable=invalid-name,missing-docstring,no-self-argument
|
||||
# pylint: disable=missing-docstring,no-self-argument
|
||||
# pylint: disable=too-few-public-methods
|
||||
x = Field('x', omitempty=True,
|
||||
encoder=(lambda x: x * 2),
|
||||
|
|
@ -158,7 +158,7 @@ class JSONObjectWithFieldsTest(unittest.TestCase):
|
|||
raise errors.DeserializationError()
|
||||
return value
|
||||
|
||||
# pylint: disable=invalid-name
|
||||
|
||||
self.MockJSONObjectWithFields = MockJSONObjectWithFields
|
||||
self.mock = MockJSONObjectWithFields(x=None, y=2, z=3)
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ class JWASignatureTest(unittest.TestCase):
|
|||
def verify(self, key, msg, sig):
|
||||
raise NotImplementedError() # pragma: no cover
|
||||
|
||||
# pylint: disable=invalid-name
|
||||
|
||||
self.Sig1 = MockSig('Sig1')
|
||||
self.Sig2 = MockSig('Sig2')
|
||||
|
||||
|
|
|
|||
|
|
@ -186,7 +186,7 @@ class JWKRSA(JWK):
|
|||
|
||||
@classmethod
|
||||
def fields_from_json(cls, jobj):
|
||||
# pylint: disable=invalid-name
|
||||
|
||||
n, e = (cls._decode_param(jobj[x]) for x in ('n', 'e'))
|
||||
public_numbers = rsa.RSAPublicNumbers(e=e, n=n)
|
||||
if 'd' not in jobj: # public key
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import six
|
|||
|
||||
|
||||
class abstractclassmethod(classmethod):
|
||||
# pylint: disable=invalid-name,too-few-public-methods
|
||||
# pylint: disable=too-few-public-methods
|
||||
"""Descriptor for an abstract classmethod.
|
||||
|
||||
It augments the :mod:`abc` framework with an abstract
|
||||
|
|
@ -172,7 +172,7 @@ class ImmutableMap(collections.Mapping, collections.Hashable):
|
|||
|
||||
|
||||
class frozendict(collections.Mapping, collections.Hashable):
|
||||
# pylint: disable=invalid-name,too-few-public-methods
|
||||
# pylint: disable=too-few-public-methods
|
||||
"""Frozen dictionary."""
|
||||
__slots__ = ('_items', '_keys')
|
||||
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ class ImmutableMapTest(unittest.TestCase):
|
|||
"""Tests for acme.jose.util.ImmutableMap."""
|
||||
|
||||
def setUp(self):
|
||||
# pylint: disable=invalid-name,too-few-public-methods
|
||||
# pylint: disable=too-few-public-methods
|
||||
# pylint: disable=missing-docstring
|
||||
from acme.jose.util import ImmutableMap
|
||||
|
||||
|
|
@ -156,7 +156,7 @@ class ImmutableMapTest(unittest.TestCase):
|
|||
self.assertEqual("B(x='foo', y='bar')", repr(self.B(x='foo', y='bar')))
|
||||
|
||||
|
||||
class frozendictTest(unittest.TestCase): # pylint: disable=invalid-name
|
||||
class frozendictTest(unittest.TestCase):
|
||||
"""Tests for acme.jose.util.frozendict."""
|
||||
|
||||
def setUp(self):
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ class ConstantTest(unittest.TestCase):
|
|||
class MockConstant(_Constant): # pylint: disable=missing-docstring
|
||||
POSSIBLE_NAMES = {}
|
||||
|
||||
self.MockConstant = MockConstant # pylint: disable=invalid-name
|
||||
self.MockConstant = MockConstant
|
||||
self.const_a = MockConstant('a')
|
||||
self.const_b = MockConstant('b')
|
||||
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ class Account(object): # pylint: disable=too-few-public-methods
|
|||
tz=pytz.UTC).replace(microsecond=0),
|
||||
creation_host=socket.getfqdn()) if meta is None else meta
|
||||
|
||||
self.id = hashlib.md5( # pylint: disable=invalid-name
|
||||
self.id = hashlib.md5(
|
||||
self.key.key.public_key().public_bytes(
|
||||
encoding=serialization.Encoding.DER,
|
||||
format=serialization.PublicFormat.SubjectPublicKeyInfo)
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ from letsencrypt.display import util as display_util
|
|||
logger = logging.getLogger(__name__)
|
||||
|
||||
# Define a helper function to avoid verbose code
|
||||
util = zope.component.getUtility # pylint: disable=invalid-name
|
||||
util = zope.component.getUtility
|
||||
|
||||
|
||||
def ask(enhancement):
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ from letsencrypt.display import util as display_util
|
|||
logger = logging.getLogger(__name__)
|
||||
|
||||
# Define a helper function to avoid verbose code
|
||||
util = zope.component.getUtility # pylint: disable=invalid-name
|
||||
util = zope.component.getUtility
|
||||
|
||||
|
||||
def choose_plugin(prepared, question):
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ class DialogHandler(logging.Handler): # pylint: disable=too-few-public-methods
|
|||
logging.Handler.__init__(self, level)
|
||||
self.height = height
|
||||
self.width = width
|
||||
# "dialog" collides with module name... pylint: disable=invalid-name
|
||||
# "dialog" collides with module name...
|
||||
self.d = dialog.Dialog() if d is None else d
|
||||
self.lines = []
|
||||
|
||||
|
|
|
|||
|
|
@ -23,10 +23,10 @@ def dest_namespace(name):
|
|||
"""ArgumentParser dest namespace (prefix of all destinations)."""
|
||||
return name.replace("-", "_") + "_"
|
||||
|
||||
private_ips_regex = re.compile( # pylint: disable=invalid-name
|
||||
private_ips_regex = re.compile(
|
||||
r"(^127\.0\.0\.1)|(^10\.)|(^172\.1[6-9]\.)|"
|
||||
r"(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^192\.168\.)")
|
||||
hostname_regex = re.compile( # pylint: disable=invalid-name
|
||||
hostname_regex = re.compile(
|
||||
r"^(([a-z0-9]|[a-z0-9][a-z0-9\-]*[a-z0-9])\.)*[a-z]+$", re.IGNORECASE)
|
||||
|
||||
|
||||
|
|
@ -173,7 +173,7 @@ class Dvsni(object):
|
|||
achall.chall.encode("token") + '.pem')
|
||||
|
||||
def _setup_challenge_cert(self, achall, s=None):
|
||||
# pylint: disable=invalid-name
|
||||
|
||||
"""Generate and write out challenge certificate."""
|
||||
cert_path = self.get_cert_path(achall)
|
||||
key_path = self.get_key_path(achall)
|
||||
|
|
|
|||
|
|
@ -355,7 +355,7 @@ class GenChallengePathTest(unittest.TestCase):
|
|||
class MutuallyExclusiveTest(unittest.TestCase):
|
||||
"""Tests for letsencrypt.auth_handler.mutually_exclusive."""
|
||||
|
||||
# pylint: disable=invalid-name,missing-docstring,too-few-public-methods
|
||||
# pylint: disable=missing-docstring,too-few-public-methods
|
||||
class A(object):
|
||||
pass
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import mock
|
|||
class DialogHandlerTest(unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
self.d = mock.MagicMock() # pylint: disable=invalid-name
|
||||
self.d = mock.MagicMock()
|
||||
|
||||
from letsencrypt.log import DialogHandler
|
||||
self.handler = DialogHandler(height=2, width=6, d=self.d)
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ class ReverterCheckpointLocalTest(unittest.TestCase):
|
|||
self.assertEqual(read_in(self.config1), "directive-dir1")
|
||||
|
||||
def test_multiple_registration_fail_and_revert(self):
|
||||
# pylint: disable=invalid-name
|
||||
|
||||
config3 = os.path.join(self.dir1, "config3.txt")
|
||||
update_file(config3, "Config3")
|
||||
config4 = os.path.join(self.dir2, "config4.txt")
|
||||
|
|
@ -173,7 +173,7 @@ class ReverterCheckpointLocalTest(unittest.TestCase):
|
|||
self.assertRaises(errors.ReverterError, self.reverter.recovery_routine)
|
||||
|
||||
def test_recover_checkpoint_revert_temp_failures(self):
|
||||
# pylint: disable=invalid-name
|
||||
|
||||
mock_recover = mock.MagicMock(
|
||||
side_effect=errors.ReverterError("e"))
|
||||
|
||||
|
|
@ -291,7 +291,7 @@ class TestFullCheckpointsReverter(unittest.TestCase):
|
|||
errors.ReverterError, self.reverter.rollback_checkpoints, "one")
|
||||
|
||||
def test_rollback_finalize_checkpoint_valid_inputs(self):
|
||||
# pylint: disable=invalid-name
|
||||
|
||||
config3 = self._setup_three_checkpoints()
|
||||
|
||||
# Check resulting backup directory
|
||||
|
|
@ -334,7 +334,7 @@ class TestFullCheckpointsReverter(unittest.TestCase):
|
|||
|
||||
@mock.patch("letsencrypt.reverter.os.rename")
|
||||
def test_finalize_checkpoint_no_rename_directory(self, mock_rename):
|
||||
# pylint: disable=invalid-name
|
||||
|
||||
self.reverter.add_to_checkpoint(self.sets[0], "perm save")
|
||||
mock_rename.side_effect = OSError
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue