Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/test-charmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
18 changes: 8 additions & 10 deletions update-gyp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand All @@ -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)

Expand All @@ -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):
Expand All @@ -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}"]
)