Skip to content
Merged
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
14 changes: 8 additions & 6 deletions .github/workflows/latex-python-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,23 @@ jobs:
- name: Check LaTeX formatting with latexindent (dry-run)
run: |
set -e
tmp_file="tmp_check_file"
for ext in tex sty cls; do
for file in $(find . -name "*.${ext}" || true); do
formatted=$(latexindent -l=.latexindent.yml -o=- "$file")
original=$(cat "$file")
if [ "$formatted" != "$original" ]; then
find . -name "*.${ext}" -type f -not -name "$tmp_file" | while read -r file; do
latexindent -m -l=.latexindent.yml -o="$tmp_file" "$file"
if ! diff -qZb "$file" "$tmp_file.${ext}" > /dev/null; then
echo "::error file=$file::File is not properly formatted. Please run latexindent locally."
rm -f "$tmp_file.${ext}"
exit 1
fi
done
rm -f "$tmp_file.${ext}"
done || exit 1
done
echo "All LaTeX files are properly formatted!"


- name: Install Python format tools
run: |
set -e
python -m pip install --upgrade pip
pip install ruff

Expand Down