mirror of
https://github.com/certbot/certbot.git
synced 2026-06-10 09:10:37 -04:00
Cleanup more pylint issues (#7848)
This PR builds on #7657 and cleans up additional unnecessary pylint comments and some stray comments referring to pylint: disable comments that have been deleted that I didn't notice in my review of that PR. * Remove stray pylint link. * Cleanup more pylint comments * Cleanup magic_typing imports * Remove unneeded pylint: enable comments
This commit is contained in:
parent
30ec4cafe1
commit
06599a1e18
25 changed files with 4 additions and 38 deletions
|
|
@ -11,6 +11,5 @@ try:
|
|||
# mypy doesn't respect modifying sys.modules
|
||||
from typing import * # pylint: disable=wildcard-import, unused-wildcard-import
|
||||
from typing import Collection, IO # type: ignore
|
||||
# pylint: enable=unused-import
|
||||
except ImportError:
|
||||
sys.modules[__name__] = TypingClass()
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ from acme import challenges
|
|||
from acme import errors
|
||||
from acme import jws as acme_jws
|
||||
from acme import messages
|
||||
from acme.magic_typing import Dict # pylint: disable=unused-import, no-name-in-module
|
||||
from acme.mixins import VersionedLEACMEMixin
|
||||
import messages_test
|
||||
import test_util
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ import six
|
|||
from six.moves import socketserver # type: ignore # pylint: disable=import-error
|
||||
|
||||
from acme import errors
|
||||
from acme.magic_typing import List # pylint: disable=unused-import, no-name-in-module
|
||||
import test_util
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ class MagicTypingTest(unittest.TestCase):
|
|||
sys.modules['typing'] = typing_class_mock
|
||||
if 'acme.magic_typing' in sys.modules:
|
||||
del sys.modules['acme.magic_typing'] # pragma: no cover
|
||||
from acme.magic_typing import Text # pylint: disable=no-name-in-module
|
||||
from acme.magic_typing import Text
|
||||
self.assertEqual(Text, text_mock)
|
||||
del sys.modules['acme.magic_typing']
|
||||
sys.modules['typing'] = temp_typing
|
||||
|
|
@ -31,7 +31,7 @@ class MagicTypingTest(unittest.TestCase):
|
|||
sys.modules['typing'] = None
|
||||
if 'acme.magic_typing' in sys.modules:
|
||||
del sys.modules['acme.magic_typing'] # pragma: no cover
|
||||
from acme.magic_typing import Text # pylint: disable=no-name-in-module
|
||||
from acme.magic_typing import Text
|
||||
self.assertTrue(Text is None)
|
||||
del sys.modules['acme.magic_typing']
|
||||
sys.modules['typing'] = temp_typing
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ import josepy as jose
|
|||
import mock
|
||||
|
||||
from acme import challenges
|
||||
from acme.magic_typing import Dict # pylint: disable=unused-import, no-name-in-module
|
||||
import test_util
|
||||
|
||||
CERT = test_util.load_comparable_cert('cert.der')
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ from six.moves import socketserver # type: ignore # pylint: disable=import-err
|
|||
from acme import challenges
|
||||
from acme import crypto_util
|
||||
from acme import errors
|
||||
from acme.magic_typing import Set # pylint: disable=unused-import, no-name-in-module
|
||||
|
||||
import test_util
|
||||
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ Translates over to:
|
|||
"/files/etc/apache2/apache2.conf/bLoCk[1]",
|
||||
]
|
||||
"""
|
||||
from acme.magic_typing import Set # pylint: disable=unused-import, no-name-in-module
|
||||
from acme.magic_typing import Set
|
||||
from certbot import errors
|
||||
from certbot.compat import os
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,4 @@
|
|||
""" Entry point for Apache Plugin """
|
||||
# Pylint does not like disutils.version when running inside a venv.
|
||||
# See: https://github.com/PyCQA/pylint/issues/73
|
||||
from distutils.version import LooseVersion
|
||||
|
||||
from certbot import util
|
||||
|
|
|
|||
|
|
@ -102,7 +102,6 @@ For this reason the internal representation of data should not ignore the case.
|
|||
import abc
|
||||
import six
|
||||
|
||||
from acme.magic_typing import Any, Dict, Optional, Tuple # pylint: disable=unused-import, no-name-in-module
|
||||
|
||||
|
||||
@six.add_metaclass(abc.ABCMeta)
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ import mock
|
|||
|
||||
import util
|
||||
|
||||
from acme.magic_typing import List # pylint: disable=unused-import, no-name-in-module
|
||||
from certbot import errors
|
||||
|
||||
from certbot_apache._internal import assertions
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ import errno
|
|||
import mock
|
||||
|
||||
from acme import challenges
|
||||
from acme.magic_typing import List # pylint: disable=unused-import, no-name-in-module
|
||||
from certbot import achallenges
|
||||
from certbot import errors
|
||||
from certbot.compat import filesystem
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
"""Nginx Configuration"""
|
||||
# https://github.com/PyCQA/pylint/issues/73
|
||||
from distutils.version import LooseVersion
|
||||
import logging
|
||||
import re
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ import re
|
|||
import shutil
|
||||
import unittest
|
||||
|
||||
from acme.magic_typing import List # pylint: disable=unused-import, no-name-in-module
|
||||
from certbot import errors
|
||||
from certbot.compat import os
|
||||
from certbot_nginx._internal import nginxparser
|
||||
|
|
|
|||
|
|
@ -11,9 +11,7 @@ import zope.interface
|
|||
|
||||
from zope.interface import interfaces as zope_interfaces
|
||||
|
||||
# pylint: disable=unused-import, no-name-in-module
|
||||
from acme.magic_typing import Any, Dict, Optional
|
||||
# pylint: enable=unused-import, no-name-in-module
|
||||
from acme.magic_typing import Any, Dict
|
||||
|
||||
from certbot import crypto_util
|
||||
from certbot import errors
|
||||
|
|
|
|||
|
|
@ -192,9 +192,6 @@ class PluginsRegistry(Mapping):
|
|||
# This prevents deadlock caused by plugins acquiring a lock
|
||||
# and ensures at least one concurrent Certbot instance will run
|
||||
# successfully.
|
||||
|
||||
# Pylint checks for super init, but also claims the super
|
||||
# has no __init__member
|
||||
self._plugins = collections.OrderedDict(sorted(six.iteritems(plugins)))
|
||||
|
||||
@classmethod
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@ import os # pylint: disable=os-module-forbidden
|
|||
import stat
|
||||
|
||||
from acme.magic_typing import List
|
||||
from acme.magic_typing import Tuple # pylint: disable=unused-import
|
||||
from acme.magic_typing import Union # pylint: disable=unused-import
|
||||
|
||||
try:
|
||||
import ntsecuritycon
|
||||
|
|
@ -17,7 +15,6 @@ try:
|
|||
import win32file
|
||||
import pywintypes
|
||||
import winerror
|
||||
# pylint: enable=import-error
|
||||
except ImportError:
|
||||
POSIX_MODE = True
|
||||
else:
|
||||
|
|
|
|||
|
|
@ -13,11 +13,9 @@ import certbot.tests.util as test_util
|
|||
from certbot.tests.util import TempDirTestCase
|
||||
|
||||
try:
|
||||
# pylint: disable=import-error
|
||||
import win32api
|
||||
import win32security
|
||||
import ntsecuritycon
|
||||
# pylint: enable=import-error
|
||||
POSIX_MODE = False
|
||||
except ImportError:
|
||||
POSIX_MODE = True
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ import unittest
|
|||
import mock
|
||||
from six.moves import reload_module # pylint: disable=import-error
|
||||
|
||||
from acme.magic_typing import List # pylint: disable=unused-import, no-name-in-module
|
||||
from certbot.compat import filesystem # pylint: disable=ungrouped-imports
|
||||
from certbot.compat import os # pylint: disable=ungrouped-imports
|
||||
import certbot.tests.util as test_util # pylint: disable=ungrouped-imports
|
||||
|
|
|
|||
|
|
@ -6,9 +6,6 @@ import unittest
|
|||
|
||||
import mock
|
||||
|
||||
from acme.magic_typing import Callable # pylint: disable=unused-import, no-name-in-module
|
||||
from acme.magic_typing import Dict # pylint: disable=unused-import, no-name-in-module
|
||||
from acme.magic_typing import Union # pylint: disable=unused-import, no-name-in-module
|
||||
from certbot.compat import os
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ import unittest
|
|||
|
||||
import mock
|
||||
|
||||
from acme.magic_typing import List # pylint: disable=unused-import, no-name-in-module
|
||||
from certbot import errors
|
||||
from certbot import util
|
||||
from certbot.compat import filesystem
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ import mock
|
|||
import six
|
||||
|
||||
from acme import messages
|
||||
from acme.magic_typing import Optional # pylint: disable=unused-import, no-name-in-module
|
||||
from certbot import errors
|
||||
from certbot import util
|
||||
from certbot._internal import constants
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ import pytz
|
|||
import six
|
||||
from six.moves import reload_module # pylint: disable=import-error
|
||||
|
||||
from acme.magic_typing import List # pylint: disable=unused-import, no-name-in-module
|
||||
from certbot import crypto_util
|
||||
from certbot import errors
|
||||
from certbot import interfaces # pylint: disable=unused-import
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ import pkg_resources
|
|||
import six
|
||||
import zope.interface
|
||||
|
||||
from acme.magic_typing import List # pylint: disable=unused-import, no-name-in-module
|
||||
from certbot import errors
|
||||
from certbot import interfaces
|
||||
from certbot._internal.plugins import standalone
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ import unittest
|
|||
import mock
|
||||
import zope.component
|
||||
|
||||
from acme.magic_typing import List # pylint: disable=unused-import, no-name-in-module
|
||||
from certbot import errors
|
||||
from certbot import interfaces
|
||||
from certbot._internal.plugins.disco import PluginsRegistry
|
||||
|
|
|
|||
|
|
@ -11,9 +11,6 @@ import six
|
|||
|
||||
from acme import challenges
|
||||
from acme import standalone as acme_standalone # pylint: disable=unused-import
|
||||
from acme.magic_typing import Dict # pylint: disable=unused-import, no-name-in-module
|
||||
from acme.magic_typing import Set # pylint: disable=unused-import, no-name-in-module
|
||||
from acme.magic_typing import Tuple # pylint: disable=unused-import, no-name-in-module
|
||||
from certbot import achallenges
|
||||
from certbot import errors
|
||||
from certbot.tests import acme_util
|
||||
|
|
|
|||
Loading…
Reference in a new issue