Skip to content

Commit cb30a53

Browse files
authored
chore: ruff format Python code (#3203)
1 parent adc61b1 commit cb30a53

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ jobs:
2121
- uses: astral-sh/ruff-action@v3
2222
with:
2323
args: "check --select=E,F,PLC,PLE,UP,W,YTT --ignore=E721,PLC0206,PLC0415,PLC1901,S101,UP031 --target-version=py39"
24+
- run: ruff format --check --diff
2425

2526
lint-js:
2627
name: Lint JS

test/fixtures/test-charmap.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def main():
1919

2020
textmap = {
2121
"cp936": "\u4e2d\u6587",
22-
"cp1252": "Lat\u012Bna",
22+
"cp1252": "Lat\u012bna",
2323
"cp932": "\u306b\u307b\u3093\u3054",
2424
}
2525
if encoding in textmap:

update-gyp.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,9 @@
1313
CHECKOUT_GYP_PATH = os.path.join(CHECKOUT_PATH, "gyp")
1414

1515
parser = argparse.ArgumentParser()
16-
parser.add_argument("--no-commit",
17-
action="store_true",
18-
dest="no_commit",
19-
help="do not run git-commit")
16+
parser.add_argument(
17+
"--no-commit", action="store_true", dest="no_commit", help="do not run git-commit"
18+
)
2019
parser.add_argument("tag", help="gyp tag to update to")
2120
args = parser.parse_args()
2221

@@ -37,8 +36,8 @@
3736

3837
print("Unzipping...")
3938
with tarfile.open(tar_file, "r:gz") as tar_ref:
40-
def is_within_directory(directory, target):
4139

40+
def is_within_directory(directory, target):
4241
abs_directory = os.path.abspath(directory)
4342
abs_target = os.path.abspath(target)
4443

@@ -47,7 +46,6 @@ def is_within_directory(directory, target):
4746
return prefix == abs_directory
4847

4948
def safe_extract(tar, path=".", members=None, *, numeric_owner=False):
50-
5149
for member in tar.getmembers():
5250
member_path = os.path.join(path, member.name)
5351
if not is_within_directory(path, member_path):
@@ -65,7 +63,7 @@ def safe_extract(tar, path=".", members=None, *, numeric_owner=False):
6563
)
6664

6765
if not args.no_commit:
68-
subprocess.check_output(["git", "add", "gyp"], cwd=CHECKOUT_PATH)
69-
subprocess.check_output([
70-
"git", "commit", "-m", f"feat(gyp): update gyp to {args.tag}"
71-
])
66+
subprocess.check_output(["git", "add", "gyp"], cwd=CHECKOUT_PATH)
67+
subprocess.check_output(
68+
["git", "commit", "-m", f"feat(gyp): update gyp to {args.tag}"]
69+
)

0 commit comments

Comments
 (0)