Skip to content

Add CI check for fomatting #2

Add CI check for fomatting

Add CI check for fomatting #2

Workflow file for this run

on:
workflow_dispatch:
push:
paths:
- "**.nix"
- "**.lock"
- ".github/workflows/nix-build.yml"
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v26
with:
nix_path: nixpkgs=channel:nixos-unstable
- run: |
nix build nixpkgs#clang-tools
find . -type f -name "*.c" -or -name "*.h" \
| xargs -i ./result/bin/clang-format -i {}
out=out=$(git status \
| grep "modified" \
| cut -d ":" -f 2 \
| sort \
| xargs \
| tee /dev/stderr \
| wc -c)
[ $out -ge 1 ] && exit 1 || exit 0