Skip to content

Commit

Permalink
ci: Set up CI for TeX files
Browse files Browse the repository at this point in the history
  • Loading branch information
kmyk committed Sep 26, 2021
1 parent eb456a7 commit 15ded6d
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/format-tex.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: format-tex

on: [push, pull_request]

jobs:
format-tex:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Install Dependencies
run: |
sudo apt install chktex
- name: Run chktex
run: |
chktex --nowarn={1,2,8,11,12,36,39} docs/*.tex
8 changes: 8 additions & 0 deletions scripts/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@ if git diff --staged --name-only | grep '\.py$'; then
|| exit 1
fi

# TeX
if git diff --staged --name-only | grep '\.tex$'; then
chktex --version \
|| { echo HINT: Please install chktex, e.g. '$ sudo apt install chktex'; exit 1; }
chktex --nowarn={1,2,8,11,12,36,39} $(git ls-files | grep '\.tex$') \
|| exit 1
fi

# Other files
for ext in yml yaml json md html mjs; do
if git diff --staged --name-only | grep '\.'$ext'$'; then
Expand Down

0 comments on commit 15ded6d

Please sign in to comment.