Skip to content

Commit 221fa98

Browse files
Fix Format (#183)
Fix Format
1 parent 95d006d commit 221fa98

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

.github/workflows/push.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ jobs:
5454
- name: Checkout
5555
uses: actions/checkout@v4.2.2
5656

57+
- name: Install Python
58+
uses: actions/setup-python@v5
59+
with:
60+
# Since 3.10 is the development version for the project
61+
python-version: '3.10'
62+
5763
- name: Install hatch
5864
run: pip install hatch==$HATCH_VERSION
5965

tests/unit/no_cheat.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import sys
22
from pathlib import Path
33

4-
DISABLE_TAG = '# pylint: disable='
4+
DISABLE_TAG = "# pylint: disable="
55

66

77
def no_cheat(diff_text: str) -> str:
8-
lines = diff_text.split('\n')
8+
lines = diff_text.split("\n")
99
removed: dict[str, int] = {}
1010
added: dict[str, int] = {}
1111
for line in lines:
@@ -14,9 +14,9 @@ def no_cheat(diff_text: str) -> str:
1414
idx = line.find(DISABLE_TAG)
1515
if idx < 0:
1616
continue
17-
codes = line[idx + len(DISABLE_TAG) :].split(',')
17+
codes = line[idx + len(DISABLE_TAG) :].split(",")
1818
for code in codes:
19-
code = code.strip().strip('\n').strip('"').strip("'")
19+
code = code.strip().strip("\n").strip('"').strip("'")
2020
if line.startswith("-"):
2121
removed[code] = removed.get(code, 0) + 1
2222
continue
@@ -26,7 +26,7 @@ def no_cheat(diff_text: str) -> str:
2626
count -= removed.get(code, 0)
2727
if count > 0:
2828
results.append(f"Do not cheat the linter: found {count} additional {DISABLE_TAG}{code}")
29-
return '\n'.join(results)
29+
return "\n".join(results)
3030

3131

3232
if __name__ == "__main__":

0 commit comments

Comments
 (0)