summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhippo91 <guillaume.peillex@gmail.com>2021-04-08 19:07:41 +0200
committerPierre Sassoulas <pierre.sassoulas@gmail.com>2021-04-09 18:45:30 +0200
commit0ec756419eb27dbc1c2a347e0afb0d74a6bf214d (patch)
treec12499a59bd5791b18799f7eb293019df9bc057b
parentefe44d8d516caec0948bc9ea81eace1139fe3505 (diff)
downloadpylint-git-0ec756419eb27dbc1c2a347e0afb0d74a6bf214d.tar.gz
Formatting
-rw-r--r--pylint/checkers/raw_metrics.py3
-rw-r--r--pylint/utils/utils.py9
2 files changed, 5 insertions, 7 deletions
diff --git a/pylint/checkers/raw_metrics.py b/pylint/checkers/raw_metrics.py
index bb3a519d4..0bdd20f69 100644
--- a/pylint/checkers/raw_metrics.py
+++ b/pylint/checkers/raw_metrics.py
@@ -24,8 +24,7 @@ from pylint.utils import diff_string
def report_raw_stats(sect, stats, old_stats):
- """calculate percentage of code / doc / comment / empty
- """
+ """calculate percentage of code / doc / comment / empty"""
total_lines = stats["total_lines"]
if not total_lines:
raise EmptyReportError()
diff --git a/pylint/utils/utils.py b/pylint/utils/utils.py
index 354d5a47a..93324d078 100644
--- a/pylint/utils/utils.py
+++ b/pylint/utils/utils.py
@@ -36,11 +36,10 @@ def normalize_text(text, line_len=DEFAULT_LINE_LENGTH, indent=""):
CMPS = ["=", "-", "+"]
-# py3k has no more cmp builtin
-if sys.version_info >= (3, 0):
- def cmp(a, b): # pylint: disable=redefined-builtin
- return (a > b) - (a < b)
+# py3k has no more cmp builtin
+def cmp(a, b): # pylint: disable=redefined-builtin
+ return (a > b) - (a < b)
def diff_string(old, new):
@@ -48,7 +47,7 @@ def diff_string(old, new):
difference
"""
diff = abs(old - new)
- diff_str = "%s%s" % (CMPS[cmp(old, new)], diff and ("%.2f" % diff) or "")
+ diff_str = "{}{}".format(CMPS[cmp(old, new)], diff and ("%.2f" % diff) or "")
return diff_str