Skip to content

Commit

Permalink
Merge pull request #2297 from AllenInstitute/feature/2297-add-linting
Browse files Browse the repository at this point in the history
CI: Rework ipt format check
  • Loading branch information
t-b authored Nov 20, 2024
2 parents a4d0676 + 501bbda commit 5fcb28b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ concurrency:
jobs:

Ipt:
name: 🔎 IPT Format check
name: 🔎 IPT checks
runs-on: [ self-hosted, Windows ]
steps:
- name: Checkout repository
Expand All @@ -49,8 +49,8 @@ jobs:
run: curl -o ipt.exe "https://byte-physics.de/public-downloads/aistorage/transfer/ipt/0.6.0/ipt.exe"
- name: IPT version
run: ./ipt.exe --version
- name: Format code
run: tools/ipt-format.sh
- name: Format and lint code
run: tools/run-ipt.sh
- name: Check for changed files
run: git diff --name-only --ignore-submodules; git diff --ignore-submodules --quiet
- name: Create patch
Expand Down
5 changes: 2 additions & 3 deletions tools/ipt-format.sh → tools/run-ipt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ else
ipt="ipt"
fi

echo "[format]" > config.toml
echo "[lint]" > config.toml
while read -r line; do
echo "files = \"$line\"" >> config.toml
done < <(git ls-files ':(attr:ipt)')

(cd $top_level && $ipt --arg-file config.toml format -i)
(cd $top_level && $ipt --arg-file config.toml lint -i)

0 comments on commit 5fcb28b

Please sign in to comment.