diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d8720d768a..16762765c2 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -21,6 +21,7 @@ jobs: - uses: astral-sh/ruff-action@v3 with: args: "check --select=E,F,PLC,PLE,UP,W,YTT --ignore=E721,PLC0206,PLC0415,PLC1901,S101,UP031 --target-version=py39" + - run: ruff format --check --diff lint-js: name: Lint JS diff --git a/test/fixtures/test-charmap.py b/test/fixtures/test-charmap.py index 63aa77bb48..9f601af4ab 100644 --- a/test/fixtures/test-charmap.py +++ b/test/fixtures/test-charmap.py @@ -19,7 +19,7 @@ def main(): textmap = { "cp936": "\u4e2d\u6587", - "cp1252": "Lat\u012Bna", + "cp1252": "Lat\u012bna", "cp932": "\u306b\u307b\u3093\u3054", } if encoding in textmap: diff --git a/update-gyp.py b/update-gyp.py index c65da41472..a822c0485f 100755 --- a/update-gyp.py +++ b/update-gyp.py @@ -13,10 +13,9 @@ CHECKOUT_GYP_PATH = os.path.join(CHECKOUT_PATH, "gyp") parser = argparse.ArgumentParser() -parser.add_argument("--no-commit", - action="store_true", - dest="no_commit", - help="do not run git-commit") +parser.add_argument( + "--no-commit", action="store_true", dest="no_commit", help="do not run git-commit" +) parser.add_argument("tag", help="gyp tag to update to") args = parser.parse_args() @@ -37,8 +36,8 @@ print("Unzipping...") with tarfile.open(tar_file, "r:gz") as tar_ref: - def is_within_directory(directory, target): + def is_within_directory(directory, target): abs_directory = os.path.abspath(directory) abs_target = os.path.abspath(target) @@ -47,7 +46,6 @@ def is_within_directory(directory, target): return prefix == abs_directory def safe_extract(tar, path=".", members=None, *, numeric_owner=False): - for member in tar.getmembers(): member_path = os.path.join(path, member.name) if not is_within_directory(path, member_path): @@ -65,7 +63,7 @@ def safe_extract(tar, path=".", members=None, *, numeric_owner=False): ) if not args.no_commit: - subprocess.check_output(["git", "add", "gyp"], cwd=CHECKOUT_PATH) - subprocess.check_output([ - "git", "commit", "-m", f"feat(gyp): update gyp to {args.tag}" - ]) + subprocess.check_output(["git", "add", "gyp"], cwd=CHECKOUT_PATH) + subprocess.check_output( + ["git", "commit", "-m", f"feat(gyp): update gyp to {args.tag}"] + )