From c1894d3e4122ea750bbd19a03eb5ea34495fc46c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Mon, 7 Dec 2015 20:13:36 +0100 Subject: [PATCH] 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. --- hooks/pre-commit | 3 +-- tools/verify-rewritemeta.sh | 15 --------------- 2 files changed, 1 insertion(+), 17 deletions(-) delete mode 100755 tools/verify-rewritemeta.sh diff --git a/hooks/pre-commit b/hooks/pre-commit index 1a2ea76eae..c0ff5d174b 100755 --- a/hooks/pre-commit +++ b/hooks/pre-commit @@ -7,5 +7,4 @@ set -o pipefail # Redirect output to stderr. exec 1>&2 -./tools/verify-rewritemeta.sh -fdroid lint +fdroid lint -f diff --git a/tools/verify-rewritemeta.sh b/tools/verify-rewritemeta.sh deleted file mode 100755 index bec2b5c49d..0000000000 --- a/tools/verify-rewritemeta.sh +++ /dev/null @@ -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