Skip to content

Commit 3acf653

Browse files
feat: Improve code-style checks and DAG checks (GoogleCloudPlatform#1057)
This change improves the following things: 1. Run pyink in --check mode, since in-place rewrites have no effect on GitHub Actions runners. 2. Run pyink with --diff so contributors can inspect formatting details and make follow-up adjustments. 3. Parallelize DAG checks to reduce overall runtime.
1 parent 19b65d1 commit 3acf653

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

scripts/code-style.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ FOLDERS_TO_FORMAT=("dags" "xlml")
2121

2222
for folder in "${FOLDERS_TO_FORMAT[@]}"
2323
do
24-
pyink "$folder" --pyink-indentation=2 --pyink-use-majority-quotes --line-length=80
24+
pyink "$folder" --pyink-indentation=2 --pyink-use-majority-quotes --line-length=80 --check --diff
2525
done
2626

2727
for folder in "${FOLDERS_TO_FORMAT[@]}"

scripts/dag-check.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@
1414

1515
export PYTHONPATH=$PWD
1616
export XLMLTEST_CONFIGS=$PWD/dags/jsonnet/
17+
export CORES="$(nproc)"
1718

18-
find dags -name '*.py' | xargs -n 1 -t python
19+
find dags -name '*.py' -print0 | xargs -0 -n 1 -P "${CORES}" -t python

0 commit comments

Comments
 (0)