Skip to content

Commit 6912cd5

Browse files
committed
feat: use prek instead of pre-commit
1 parent 8bde74f commit 6912cd5

File tree

4 files changed

+18
-5
lines changed

4 files changed

+18
-5
lines changed

.github/workflows/update-generated.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,23 @@ jobs:
3939
- uses: astral-sh/setup-uv@803947b9bd8e9f986429fa0c5a41c367cd732b41 # v7.2.1
4040
with:
4141
version: 0.9.28
42+
- name: Get cache tag
43+
id: get-date
44+
run: |
45+
echo "cache_tag=$(/bin/date --utc '+%Y%m')" >> "$GITHUB_OUTPUT"
46+
echo "previous_cache_tag=$(/bin/date --date='1 month ago' --utc '+%Y%m')" >> "$GITHUB_OUTPUT"
47+
shell: bash
4248
- uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
49+
id: pre-commit-cache
4350
with:
44-
path: ~/.cache/pre-commit
45-
key: ${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
51+
path: |
52+
~/.cache/prek
53+
~/.cache/kingfisher
54+
key: ${{ runner.os }}-prek-${{ steps.get-date.outputs.cache_tag }}-${{ hashFiles('.pre-commit-config.yaml') }}
55+
restore-keys: |
56+
${{ runner.os }}-prek-${{ steps.get-date.outputs.cache_tag }}
57+
${{ runner.os }}-prek-${{ steps.get-date.outputs.previous_cache_tag }}
58+
${{ runner.os }}-prek-
4659
- name: Install dependencies
4760
run: uv pip install --system -e .[dev]
4861
- run: |

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ weblate_language_data/languages.py: languages.csv aliases.csv cldr.csv extraplur
99

1010
PLURALS_DIFF.md: languages.csv cldr.csv gettext.csv translate.csv scripts/list-diff.py
1111
./scripts/list-diff.py
12-
pre-commit run --files PLURALS_DIFF.md || true
12+
prek run --files PLURALS_DIFF.md || true
1313

1414
cldr.csv: modules/cldr-json/cldr-json/cldr-core/supplemental/plurals.json modules/cldr-json/cldr-json/cldr-localenames-full/main/en/languages.json scripts/export-cldr.py languages.csv
1515
./scripts/export-cldr.py

scripts/export-macrolanguages.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,6 @@
7777

7878
# Black format code
7979
subprocess.run(
80-
["pre-commit", "run", "--files", "weblate_language_data/ambiguous.py"],
80+
["prek", "run", "--files", "weblate_language_data/ambiguous.py"],
8181
check=False,
8282
)

scripts/export-plural-tags.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,6 @@
157157

158158
# Apply coding style
159159
subprocess.run(
160-
["pre-commit", "run", "--files", "weblate_language_data/plural_tags.py"],
160+
["prek", "run", "--files", "weblate_language_data/plural_tags.py"],
161161
check=False,
162162
)

0 commit comments

Comments
 (0)