Skip to content

Commit 0fc2f64

Browse files
committed
Add latexindent check workflow to validate .tex file formatting
1 parent d3598c1 commit 0fc2f64

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

.github/workflows/build_and_test.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,24 @@ jobs:
5555

5656
- name: Run compilability checker
5757
run: python .github/workflows/test_scripts/check_compilability.py
58+
59+
latexindent-check:
60+
runs-on: ubuntu-latest
61+
steps:
62+
- uses: actions/checkout@v4
63+
64+
- name: Install TeX Live and latexindent dependencies
65+
run: |
66+
sudo apt-get update
67+
sudo apt-get install -y texlive texlive-latex-extra perl libyaml-tiny-perl libfile-homedir-perl libunicode-gcstring-perl libfile-find-rule-perl
68+
69+
- name: Check formatting of all .tex files
70+
run: |
71+
find . -name "*.tex" | while read file; do
72+
latexindent "$file" > "$file.formatted"
73+
if ! diff -q "$file" "$file.formatted" > /dev/null; then
74+
echo "::error file=$file::File is not properly formatted. Run 'make format' locally."
75+
exit 1
76+
fi
77+
rm "$file.formatted"
78+
done

0 commit comments

Comments
 (0)