aboutsummaryrefslogtreecommitdiffstats
path: root/t/chainlint/token-pasting.expect
diff options
context:
space:
mode:
authorEric Sunshine <sunshine@sunshineco.com>2024-09-10 00:10:12 -0400
committerJunio C Hamano <gitster@pobox.com>2024-09-10 10:01:40 -0700
commite44f15ba3ee873b5df5e8e5d8cc018df288472ef (patch)
tree8718076d76999f67df5c99c70f6a211709976c45 /t/chainlint/token-pasting.expect
parent588ef84ecef2c9782598529ba6511d4cb72ec158 (diff)
downloadgit-e44f15ba3ee873b5df5e8e5d8cc018df288472ef.tar.gz
chainlint: make error messages self-explanatory
The annotations emitted by chainlint to indicate detected problems are overly terse, so much so that developers new to the project -- those who should most benefit from the linting -- may find them baffling. For instance, although the author of chainlint and seasoned Git developers may understand that "?!AMP?!" is an abbreviation of "ampersand" and indicates a break in the &&-chain, this may not be obvious to newcomers. The "?!LOOP?!" case is particularly serious because that terse single word does nothing to convey that the loop body should end with "|| return 1" (or "|| exit 1" in a subshell) to ensure that a failing command in the body aborts the loop immediately. Moreover, unlike &&-chaining which is ubiquitous in Git tests, the "|| return 1" idiom is relatively infrequent, thus may be harder for a newcomer to discover by consulting nearby code. Address these shortcomings by emitting human-readable messages which both explain the problem and give a strong hint about how to correct it. Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/chainlint/token-pasting.expect')
-rw-r--r--t/chainlint/token-pasting.expect8
1 files changed, 4 insertions, 4 deletions
diff --git a/t/chainlint/token-pasting.expect b/t/chainlint/token-pasting.expect
index 64f3235d26..387189b6de 100644
--- a/t/chainlint/token-pasting.expect
+++ b/t/chainlint/token-pasting.expect
@@ -2,13 +2,13 @@
3 git config filter.rot13.clean ./rot13.sh &&
4
5 {
-6 echo "*.t filter=rot13" ?!AMP?!
+6 echo "*.t filter=rot13" ?!LINT: missing '&&'?!
7 echo "*.i ident"
8 } >.gitattributes &&
9
10 {
-11 echo a b c d e f g h i j k l m ?!AMP?!
-12 echo n o p q r s t u v w x y z ?!AMP?!
+11 echo a b c d e f g h i j k l m ?!LINT: missing '&&'?!
+12 echo n o p q r s t u v w x y z ?!LINT: missing '&&'?!
13 echo '$Id$'
14 } >test &&
15 cat test >test.t &&
@@ -19,7 +19,7 @@
20 git checkout -- test test.t test.i &&
21
22 echo "content-test2" >test2.o &&
-23 echo "content-test3 - filename with special characters" >"test3 'sq',$x=.o" ?!AMP?!
+23 echo "content-test3 - filename with special characters" >"test3 'sq',$x=.o" ?!LINT: missing '&&'?!
24
25 downstream_url_for_sed=$(
26 printf "%sn" "$downstream_url" |