Skip to content

Commit d0aab9f

Browse files
author
Paolo Tranquilli
committed
Fix sync recipes and add base justfile
Both the justfile and the pre-commit configuration for the `pr-check` sync were broken: * justfiles run recipes one line at a time in a fresh shell, so the venv activation was not working * the pre-commit config was relying on an installed `ruamel.yaml` pakcage, but the default one installable via `apt` on Ubuntu 24.04 is old and generates different output (with formatting differences). Now: * the venv dance is put in a separate bash script * both just and pre-commit will use that same script, so both problems will be fixed As a bonus, a root `justfile` is added exposing the `update-pr-checks` recipes plus a `build` one. Running `just` without arguments will also now call the default `sync` recipes that will call both of the above.
1 parent d99c7e8 commit d0aab9f

File tree

4 files changed

+18
-7
lines changed

4 files changed

+18
-7
lines changed

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ repos:
1616
name: Synchronize PR check workflows
1717
files: ^.github/workflows/__.*\.yml$|^pr-checks
1818
language: system
19-
entry: python3 pr-checks/sync.py
19+
entry: pr-checks/sync.sh
2020
pass_filenames: false

justfile

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
sync: build update-pr-checks
2+
3+
update-pr-checks:
4+
pr-checks/sync.sh
5+
6+
build:
7+
npm run build

pr-checks/justfile

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1 @@
1-
# Perform all necessary steps to update the PR checks
2-
update-pr-checks:
3-
python3 -m venv env
4-
source env/bin/activate
5-
pip3 install ruamel.yaml
6-
python3 sync.py
1+
set fallback := true

pr-checks/sync.sh

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
set -e
3+
4+
cd "$(dirname "$0")"
5+
python3 -m venv env
6+
source env/bin/activate
7+
pip3 install ruamel.yaml
8+
python3 sync.py
9+

0 commit comments

Comments
 (0)