Skip to content

Commit

Permalink
fmt patch
Browse files Browse the repository at this point in the history
  • Loading branch information
sundarshankar89 committed Jan 13, 2025
1 parent 95d006d commit 42f5624
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/unit/no_cheat.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import sys
from pathlib import Path

DISABLE_TAG = '# pylint: disable='
DISABLE_TAG = "# pylint: disable="


def no_cheat(diff_text: str) -> str:
lines = diff_text.split('\n')
lines = diff_text.split("\n")
removed: dict[str, int] = {}
added: dict[str, int] = {}
for line in lines:
Expand All @@ -14,9 +14,9 @@ def no_cheat(diff_text: str) -> str:
idx = line.find(DISABLE_TAG)
if idx < 0:
continue
codes = line[idx + len(DISABLE_TAG) :].split(',')
codes = line[idx + len(DISABLE_TAG) :].split(",")
for code in codes:
code = code.strip().strip('\n').strip('"').strip("'")
code = code.strip().strip("\n").strip('"').strip("'")
if line.startswith("-"):
removed[code] = removed.get(code, 0) + 1
continue
Expand All @@ -26,7 +26,7 @@ def no_cheat(diff_text: str) -> str:
count -= removed.get(code, 0)
if count > 0:
results.append(f"Do not cheat the linter: found {count} additional {DISABLE_TAG}{code}")
return '\n'.join(results)
return "\n".join(results)


if __name__ == "__main__":
Expand Down

0 comments on commit 42f5624

Please sign in to comment.