summaryrefslogtreecommitdiff
path: root/pylint/interfaces.py
diff options
context:
space:
mode:
authorClaudiu Popa <pcmanticore@gmail.com>2018-09-16 17:33:50 +0200
committerClaudiu Popa <pcmanticore@gmail.com>2018-09-17 09:07:42 +0200
commit3f2842400795ae1aaffc4ae6c35c4ef26857c239 (patch)
tree057fb96b25b851998edce6dd40b8e496755422a1 /pylint/interfaces.py
parentc8e0992d31b831b7d60b1e8582b84068d50c3afd (diff)
downloadpylint-git-3f2842400795ae1aaffc4ae6c35c4ef26857c239.tar.gz
Reformat the code with black
Diffstat (limited to 'pylint/interfaces.py')
-rw-r--r--pylint/interfaces.py20
1 files changed, 11 insertions, 9 deletions
diff --git a/pylint/interfaces.py b/pylint/interfaces.py
index 8e6cda53e..378585c74 100644
--- a/pylint/interfaces.py
+++ b/pylint/interfaces.py
@@ -15,20 +15,21 @@
"""Interfaces for Pylint objects"""
from collections import namedtuple
-Confidence = namedtuple('Confidence', ['name', 'description'])
+Confidence = namedtuple("Confidence", ["name", "description"])
# Warning Certainties
-HIGH = Confidence('HIGH', 'No false positive possible.')
-INFERENCE = Confidence('INFERENCE', 'Warning based on inference result.')
-INFERENCE_FAILURE = Confidence('INFERENCE_FAILURE',
- 'Warning based on inference with failures.')
-UNDEFINED = Confidence('UNDEFINED',
- 'Warning without any associated confidence level.')
+HIGH = Confidence("HIGH", "No false positive possible.")
+INFERENCE = Confidence("INFERENCE", "Warning based on inference result.")
+INFERENCE_FAILURE = Confidence(
+ "INFERENCE_FAILURE", "Warning based on inference with failures."
+)
+UNDEFINED = Confidence("UNDEFINED", "Warning without any associated confidence level.")
CONFIDENCE_LEVELS = [HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED]
class Interface:
"""Base class for interfaces."""
+
@classmethod
def is_implemented_by(cls, instance):
return implements(instance, cls)
@@ -38,7 +39,7 @@ def implements(obj, interface):
"""Return true if the give object (maybe an instance or class) implements
the interface.
"""
- kimplements = getattr(obj, '__implements__', ())
+ kimplements = getattr(obj, "__implements__", ())
if not isinstance(kimplements, (list, tuple)):
kimplements = (kimplements,)
for implementedinterface in kimplements:
@@ -72,6 +73,7 @@ class IRawChecker(IChecker):
class ITokenChecker(IChecker):
"""Interface for checkers that need access to the token list."""
+
def process_tokens(self, tokens):
"""Process a module.
@@ -97,4 +99,4 @@ class IReporter(Interface):
"""
-__all__ = ('IRawChecker', 'IAstroidChecker', 'ITokenChecker', 'IReporter')
+__all__ = ("IRawChecker", "IAstroidChecker", "ITokenChecker", "IReporter")