All commits to servo must pass a source code tidiness check. The check may be
run with ./mach test-tidy
. As a result, it is a good idea to run this check
locally before submitting or updating a pull request.
It may be helpful to create a pre-commit
or pre-push
Git Hook to do the
heavy lifting for you. You could add somthing like the following to
.git/hooks/pre-commit
or .git/hooks/pre-push
and make it executable to
acheive this.
#!/bin/sh
./mach test-tidy --faster
if [[ $? != 0 ]]; then
echo >&2 "./mach test-tidy failed: please fix the errors above"
exit 1
fi
If you're using a unix shell, something like the following should work.
$ cat > .git/hooks/pre-commit << EOF
#!/bin/sh
./mach test-tidy --faster
if [[ \$? != 0 ]]; then
echo >&2 "./mach test-tidy failed: please fix the errors above"
exit 1
fi
EOF
$ chmod 755 .git/hooks/pre-commit