summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Sassoulas <pierre.sassoulas@gmail.com>2021-03-27 22:06:58 +0100
committerPierre Sassoulas <pierre.sassoulas@gmail.com>2021-03-28 16:30:10 +0200
commitcd4168366b79a7782287e0b7162fbfe4f67535f8 (patch)
treeba9215a2d0998c01594beacb6ba690fefa3f84f3
parent59a8454866c8336b91b13bc680e582a6b3d656a5 (diff)
downloadpylint-git-cd4168366b79a7782287e0b7162fbfe4f67535f8.tar.gz
Fix classes do not defining 4 ordering comparison methods
-rw-r--r--pylint/checkers/base_checker.py3
-rw-r--r--pylint/checkers/similar.py3
2 files changed, 4 insertions, 2 deletions
diff --git a/pylint/checkers/base_checker.py b/pylint/checkers/base_checker.py
index 9aa474f18..4baf8e57b 100644
--- a/pylint/checkers/base_checker.py
+++ b/pylint/checkers/base_checker.py
@@ -14,7 +14,7 @@
# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
# For details: https://github.com/PyCQA/pylint/blob/master/COPYING
-
+import functools
from inspect import cleandoc
from typing import Any
@@ -26,6 +26,7 @@ from pylint.message.message_definition import MessageDefinition
from pylint.utils import get_rst_section, get_rst_title
+@functools.total_ordering
class BaseChecker(OptionsProviderMixIn):
# checker name (you may reuse an existing one)
diff --git a/pylint/checkers/similar.py b/pylint/checkers/similar.py
index 5495e5c7a..6b6337d29 100644
--- a/pylint/checkers/similar.py
+++ b/pylint/checkers/similar.py
@@ -24,7 +24,7 @@
# pylint: disable=redefined-builtin
"""a similarities / code duplication command line tool and pylint checker
"""
-
+import functools
import re
import sys
from collections import defaultdict
@@ -223,6 +223,7 @@ def stripped_lines(lines, ignore_comments, ignore_docstrings, ignore_imports):
return strippedlines
+@functools.total_ordering
class LineSet:
"""Holds and indexes all the lines of a single source file"""