CI Enforcement

Pre-commit hook

Add to .pre-commit-config.yaml:

- repo: https://github.com/TurtleTech-ehf/snapper
  rev: v0.3.1
  hooks:
    - id: snapper

This runs snapper --in-place on changed files matching .org, .tex, .md, and .txt.

Manual GitHub Actions

If you prefer manual setup over the composite action:

- name: Install snapper
  run: cargo binstall -y snapper-fmt

- name: Check formatting
  run: snapper --check paper.org sections/*.org

For structured output:

- name: Check with SARIF
  run: snapper --check --output-format sarif **/*.org > snapper.sarif || true

- uses: github/codeql-action/upload-sarif@v3
  with:
    sarif_file: snapper.sarif

Preview changes in CI

Use --diff to show what would change:

- name: Show formatting diff
  run: snapper --diff paper.org sections/*.org

GitLab CI

format-check:
  image: rust:latest
  script:
    - cargo binstall -y snapper-fmt
    - snapper --check **/*.org **/*.tex **/*.md
  allow_failure: false

Makefile integration

.PHONY: fmt fmt-check

fmt:
        snapper --in-place paper.org sections/*.org

fmt-check:
        snapper --check paper.org sections/*.org