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
17 changes: 15 additions & 2 deletions .github/workflows/update-generated.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,23 @@ jobs:
- uses: astral-sh/setup-uv@803947b9bd8e9f986429fa0c5a41c367cd732b41 # v7.2.1
with:
version: 0.9.28
- name: Get cache tag
id: get-date
run: |
echo "cache_tag=$(/bin/date --utc '+%Y%m')" >> "$GITHUB_OUTPUT"
echo "previous_cache_tag=$(/bin/date --date='1 month ago' --utc '+%Y%m')" >> "$GITHUB_OUTPUT"
shell: bash
- uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
id: pre-commit-cache
with:
path: ~/.cache/pre-commit
key: ${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
path: |
~/.cache/prek
~/.cache/kingfisher
key: ${{ runner.os }}-prek-${{ steps.get-date.outputs.cache_tag }}-${{ hashFiles('.pre-commit-config.yaml') }}
restore-keys: |
${{ runner.os }}-prek-${{ steps.get-date.outputs.cache_tag }}
${{ runner.os }}-prek-${{ steps.get-date.outputs.previous_cache_tag }}
${{ runner.os }}-prek-
- name: Install dependencies
run: uv pip install --system -e .[dev]
- run: |
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ weblate_language_data/languages.py: languages.csv aliases.csv cldr.csv extraplur

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

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
./scripts/export-cldr.py
Expand Down
2 changes: 1 addition & 1 deletion scripts/export-macrolanguages.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,6 @@

# Black format code
subprocess.run(
["pre-commit", "run", "--files", "weblate_language_data/ambiguous.py"],
["prek", "run", "--files", "weblate_language_data/ambiguous.py"],
check=False,
)
2 changes: 1 addition & 1 deletion scripts/export-plural-tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,6 @@

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