mirror of
https://github.com/apple/container.git
synced 2026-07-12 20:47:04 +00:00
b1577d8d07
- Closes #639. - Adds swift format configuration that removes lint checks so we can use `swift lint` to perform format-only tests. - Adds `check` target that invokes format and header checks. - Adds pre-commit script that runs `make check`. - Adds `pre-commit` target that installs the check script as a pre-commit hook. ## Type of Change - [ ] Bug fix - [x] New feature - [ ] Breaking change - [x] Documentation update ## Motivation and Context Avoids wasting time and commit rewrites. ## Testing - [x] Tested locally - [ ] Added/updated tests - [x] Added/updated docs
17 lines
315 B
Bash
Executable File
17 lines
315 B
Bash
Executable File
#! /bin/bash -e
|
|
|
|
setup_error() {
|
|
echo failed to run: $1 1>&2
|
|
echo run '"make pre-commit"' and try again 1>&2
|
|
exit 1
|
|
}
|
|
|
|
if [ ! -z "${PRECOMMIT_NOFMT}" ] ; then
|
|
exit 0
|
|
fi
|
|
|
|
echo checking formatting and licenses 1>&2
|
|
project_pathname=$(git rev-parse --show-toplevel)
|
|
cd "${project_pathname}"
|
|
make check
|