# Local git hooks. Install once with: lefthook install # Mirrors the "Repository contracts" job in .github/workflows/ci.yml. pre-commit: parallel: true commands: shell-syntax: glob: "{scripts,tests,packaging}/**/*.sh" run: for f in {staged_files}; do bash -n "$f" || exit 1; done json: glob: "{config,packaging}/**/*.json" run: for f in {staged_files}; do jq empty "$f" || exit 1; done desktop-entry: glob: "*.desktop" run: desktop-file-validate {staged_files} changelog-width: glob: "CHANGELOG.md" run: >- git diff --cached -U0 -- CHANGELOG.md | awk '/^\+[^+]/ && length($0) > 111 { print "CHANGELOG.md: added line over 110 characters: " substr($0, 2); bad = 1 } END { exit bad }' pre-push: commands: packaging-contracts: run: >- bash tests/managed_payload_build_contract_test.sh . && bash tests/flatpak_packaging_test.sh . && bash tests/native_packaging_test.sh .