diff --git a/.github/workflows/build-pr.yml b/.github/workflows/build-pr.yml index ab34e5ddd1..54df7dedc3 100644 --- a/.github/workflows/build-pr.yml +++ b/.github/workflows/build-pr.yml @@ -39,7 +39,7 @@ concurrency: jobs: Ipt: - name: 🔎 IPT Format check + name: 🔎 IPT checks runs-on: [ self-hosted, Windows ] steps: - name: Checkout repository @@ -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 diff --git a/tools/ipt-format.sh b/tools/run-ipt.sh similarity index 67% rename from tools/ipt-format.sh rename to tools/run-ipt.sh index d36fe69cd8..d244618610 100755 --- a/tools/ipt-format.sh +++ b/tools/run-ipt.sh @@ -16,6 +16,8 @@ then exit 1 fi +cd $top_level + if [ -n "$CI" ] then ipt="./ipt.exe" @@ -27,5 +29,10 @@ echo "[format]" > config.toml while read -r line; do echo "files = \"$line\"" >> config.toml done < <(git ls-files ':(attr:ipt)') +$ipt --arg-file config.toml format -i -(cd $top_level && $ipt --arg-file config.toml format -i) +echo "[lint]" >> config.toml +while read -r line; do + echo "files = \"$line\"" >> config.toml +done < <(git ls-files ':(attr:ipt)') +$ipt --arg-file config.toml lint -i