diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ab943be0d..709d9f104 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: c59bba8fb259db0fec2bbb77ad8ba51ea7341b56 # frozen: v0.15.20 + rev: f12be1ebaa5351c1fc76472de98db2c3446c8253 # frozen: v0.16.10 hooks: - id: ruff-check args: [--fix, --exit-non-zero-on-fix] @@ -20,7 +20,7 @@ repos: - id: trailing-whitespace - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 1a4bb160cab6417b3045e1b37b6b72449243e658 # frozen: 0.37.4 + rev: 4f85d46a92dc17713078e5de73f8a13190edf6fc # frozen: 0.38.2 hooks: - id: check-github-workflows @@ -35,7 +35,7 @@ repos: - id: check-useless-excludes - repo: https://github.com/zizmorcore/zizmor-pre-commit - rev: e3eebf65325ccc992422292cb7a4baee967cf815 # frozen: v1.26.1 + rev: fa412071e4f5d44d44f9e365f4676f9df92456a2 # frozen: v1.30.1 hooks: - id: zizmor args: [--fix] diff --git a/manage_translation.py b/manage_translation.py index 0266629e4..7af08a87f 100755 --- a/manage_translation.py +++ b/manage_translation.py @@ -13,18 +13,19 @@ # * warn_about_files_to_delete: lists files that are not available upstream # * generate_commit_msg: generates commit message with co-authors -from argparse import ArgumentParser import os +import sys +from argparse import ArgumentParser +from collections.abc import Iterable from contextlib import chdir from dataclasses import dataclass from pathlib import Path -from subprocess import call, run, CalledProcessError -import sys +from subprocess import CalledProcessError, call, run from tempfile import TemporaryDirectory -from typing import Self, Iterable +from typing import Self from warnings import warn -from polib import pofile, POFile +from polib import POFile, pofile from transifex.api import transifex_api LANGUAGE = 'pl' @@ -38,7 +39,7 @@ def fetch(): """ if (code := call('tx --version', shell=True)) != 0: sys.stderr.write('The Transifex client app is required.\n') - exit(code) + sys.exit(code) lang = LANGUAGE _call(f'tx pull -l {lang} --minimum-perc=1 --force --skip') for file in Path().rglob('*.po'): @@ -47,7 +48,7 @@ def fetch(): def _call(command: str): if (return_code := call(command, shell=True)) != 0: - exit(return_code) + sys.exit(return_code) def recreate_tx_config():