File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments