pre-commit hook: use lint -f

This avoids calling rewritemeta separately, which means parsing all the
metadata files once instead of twice.

This reduces the running time of the pre-commit script from ~3s to ~2s
on my machine.
This commit is contained in:
Daniel Martí 2015-12-07 20:13:36 +01:00
parent cd8aadaa69
commit c1894d3e41
2 changed files with 1 additions and 17 deletions

View file

@ -7,5 +7,4 @@ set -o pipefail
# Redirect output to stderr. # Redirect output to stderr.
exec 1>&2 exec 1>&2
./tools/verify-rewritemeta.sh fdroid lint -f
fdroid lint

View file

@ -1,15 +0,0 @@
#!/bin/bash
# Check that there are no errors in the metadata files and that they are
# formatted correctly.
set -o errexit
set -o nounset
set -o pipefail
files=$(fdroid rewritemeta -l)
if [[ -n "$files" ]]; then
echo "ERROR: Run rewritemeta to fix formatting on these files:"
echo "$files"
exit 1
fi