From 2030240849a1a3c14b54428fb2f73c662e62d4a4 Mon Sep 17 00:00:00 2001 From: Alexis Hildebrandt Date: Thu, 22 Jan 2015 07:25:49 +0100 Subject: [tests] Move untested_options to CheckBaselineTests --- test/CheckBaselineTests.py | 29 +++++++++++++++++++++++++++++ test/CheckOptions.py | 29 ----------------------------- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/test/CheckBaselineTests.py b/test/CheckBaselineTests.py index 404c12db..3c3e590b 100755 --- a/test/CheckBaselineTests.py +++ b/test/CheckBaselineTests.py @@ -18,6 +18,35 @@ class CheckBaselineTests (CheckOptions): CheckOptions.__init__(self, args) self.missing_baseline_tests = set() + self.untested_options = [ + 'anon', + 'args-only', + 'cache', + 'debug', + 'download', + 'file', + 'force-color', + 'force-pager', + 'full-help', + 'help', + 'help-calc', + 'help-comm', + 'help-disp', + 'import', + 'init-file', + 'no-color', + 'options', + 'price-db', + 'price-exp', + 'revalued-total', + 'script', + 'seed', + 'trace', + 'verbose', + 'verify', + 'version' + ] + def main(self): for option in self.ledger_options(): if option in self.untested_options: continue diff --git a/test/CheckOptions.py b/test/CheckOptions.py index d9565600..57d711db 100755 --- a/test/CheckOptions.py +++ b/test/CheckOptions.py @@ -24,35 +24,6 @@ class CheckOptions (object): self.missing_options = set() self.unknown_options = set() - self.untested_options = [ - 'anon', - 'args-only', - 'cache', - 'debug', - 'download', - 'file', - 'force-color', - 'force-pager', - 'full-help', - 'help', - 'help-calc', - 'help-comm', - 'help-disp', - 'import', - 'init-file', - 'no-color', - 'options', - 'price-db', - 'price-exp', - 'revalued-total', - 'script', - 'seed', - 'trace', - 'verbose', - 'verify', - 'version' - ] - self.known_alternates = [ 'cost', 'first', -- cgit v1.2.3 From 2d45bd8c258510a3ccffccae1f72e062b7203664 Mon Sep 17 00:00:00 2001 From: Alexis Hildebrandt Date: Fri, 23 Jan 2015 16:13:54 +0100 Subject: [tools] Improve prepare git commit message hook by ignoring merge commits and commits with a message already containing `[ci skip]`. --- tools/prepare-commit-msg | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/tools/prepare-commit-msg b/tools/prepare-commit-msg index e103888a..ab351760 100755 --- a/tools/prepare-commit-msg +++ b/tools/prepare-commit-msg @@ -8,6 +8,12 @@ function add_ci_skip() { pattern="$1"; shift + source="$1" + + # Don't add [ci skip] if it's already in the commit message source + grep '\[ci skip\]' "$source" 2>&1 >/dev/null + [ $? -eq 0 ] && return + if [ $(git diff --cached --name-only | grep --count "$pattern") -eq 0 ]; then tempfile=$(mktemp $0.XXXXXX) cat - "$1" < "$tempfile" @@ -19,9 +25,14 @@ function add_ci_skip() # comment or remove the next line. [ci skip] EOF - mv "$tempfile" "$1" + mv "$tempfile" "$source" fi } ## MAIN -add_ci_skip '\(^src\|^test\|^doc/ledger3.texi\|^\.travis.yml\|CMakeLists.txt\)' "$@" +file="$1" +source="$2" + +# Skip merge commits +[ "$source" = "merge" ] && exit 0 +add_ci_skip '\(^src\|^test\|^doc/ledger3.texi\|^\.travis.yml\|CMakeLists.txt\)' "$file" -- cgit v1.2.3 From d94d164b65258d2867245a63877ca75ec3bd471a Mon Sep 17 00:00:00 2001 From: Alexis Hildebrandt Date: Fri, 23 Jan 2015 16:36:07 +0100 Subject: [tests] Ignore comment lines when checking texinfo so that "empty" options are also reported as undocumented. --- test/CheckTexinfo.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/CheckTexinfo.py b/test/CheckTexinfo.py index eedd975d..34d0e153 100755 --- a/test/CheckTexinfo.py +++ b/test/CheckTexinfo.py @@ -30,6 +30,7 @@ class CheckTexinfo (CheckOptions): item_regex = re.compile('^@item --([-A-Za-z]+)') itemx_regex = re.compile('^@itemx') fix_regex = re.compile('FIX') + comment_regex = re.compile('^\s*@c') for line in open(filename): line = line.strip() if state == state_normal: @@ -50,7 +51,7 @@ class CheckTexinfo (CheckOptions): opt_doc = str() elif itemx_regex.match(line): continue - else: + elif not comment_regex.match(line): opt_doc += line return options -- cgit v1.2.3