Skip to content

Commit f4f2c40

Browse files
committed
Improve error message for ruleset coverage checker.
Indicates which docs to read for improvements.
1 parent 7dc4d58 commit f4f2c40

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

test-ruleset-coverage.sh

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,25 @@
66
cd $(dirname $0)
77
TMP=`mktemp`
88
trap 'rm "$TMP"' EXIT
9+
if ! [ -d https-everywhere-checker ] ; then
10+
echo "Submodule https-everywhere-checker is missing. Run"
11+
echo "./install-dev-dependencies.sh"
12+
exit 1
13+
fi
914
# Git log gives us all changed files. Pipe that through ls to eliminate files
1015
# that have been deleted.
1116
if ! git log --name-only --date=local --since="2015-02-12 6:00" --pretty=format: \
1217
src/chrome/content/rules/ | sort -u | \
1318
xargs ls 2>/dev/null | xargs python2.7 https-everywhere-checker/src/https_everywhere_checker/check_rules.py \
14-
https-everywhere-checker/coverage.checker.config ; then
15-
echo "Ruleset test coverage was insufficient. Please add <test url=...> tags " \
16-
"to ruleset with additional HTTP URLs to test rewriting and fetching."
19+
https-everywhere-checker/coverage.checker.config; then
20+
echo "Ruleset test coverage was insufficient."
21+
echo ""
22+
echo "Under the new ruleset testing rules (February 2015), any modified ruleset"
23+
echo "must have sufficient test coverage. You can often improve test coverage by"
24+
echo "adding <test url='...' /> tags, or by restructuring the rule to avoid"
25+
echo "wildcard <target> tags. See these documents:"
26+
echo "https://github.com/EFForg/https-everywhere/blob/master/ruleset-testing.md"
27+
echo "https://github.com/EFForg/https-everywhere/blob/master/ruleset-style.md"
1728
exit 1
1829
else
1930
exit 0

0 commit comments

Comments
 (0)