Skip to content

Commit 0e20547

Browse files
authored
Merge pull request #22 from IAS-Uni-Siegen/minor-workflow-update
Minor workflow update
2 parents 0774027 + 52ab069 commit 0e20547

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

.github/workflows/latex-python-ci.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,23 @@ jobs:
2525
- name: Check LaTeX formatting with latexindent (dry-run)
2626
run: |
2727
set -e
28+
tmp_file="tmp_check_file"
2829
for ext in tex sty cls; do
29-
for file in $(find . -name "*.${ext}" || true); do
30-
formatted=$(latexindent -l=.latexindent.yml -o=- "$file")
31-
original=$(cat "$file")
32-
if [ "$formatted" != "$original" ]; then
30+
find . -name "*.${ext}" -type f -not -name "$tmp_file" | while read -r file; do
31+
latexindent -m -l=.latexindent.yml -o="$tmp_file" "$file"
32+
if ! diff -qZb "$file" "$tmp_file.${ext}" > /dev/null; then
3333
echo "::error file=$file::File is not properly formatted. Please run latexindent locally."
34+
rm -f "$tmp_file.${ext}"
3435
exit 1
3536
fi
36-
done
37+
rm -f "$tmp_file.${ext}"
38+
done || exit 1
3739
done
3840
echo "All LaTeX files are properly formatted!"
3941
40-
4142
- name: Install Python format tools
4243
run: |
44+
set -e
4345
python -m pip install --upgrade pip
4446
pip install ruff
4547

0 commit comments

Comments
 (0)