summaryrefslogtreecommitdiff
path: root/t/chainlint.sed
diff options
context:
space:
mode:
authorEric Sunshine <sunshine@sunshineco.com>2021-12-13 01:30:51 -0500
committerJunio C Hamano <gitster@pobox.com>2021-12-13 14:15:29 -0800
commitfbd992b61b3acb6ce235d678bfe65a60c503dddd (patch)
treec2d935f19361d54ef0cebae4a2da36aff301c445 /t/chainlint.sed
parentdb8c7a1cc02e545dd75b55e2ccbab2de51cd06ae (diff)
downloadgit-fbd992b61b3acb6ce235d678bfe65a60c503dddd.tar.gz
chainlint.sed: improve ?!SEMI?! placement accuracy
When chainlint.sed detects commands separated by a semicolon rather than by `&&`, it places a ?!SEMI?! annotation at the beginning of the line. However, this is an unusual location for programmers accustomed to error messages (from compilers, for instance) indicating the exact point of the problem. Therefore, relocate the ?!SEMI?! annotation to the location of the semicolon in order to better direct the programmer's attention to the source of the problem. Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/chainlint.sed')
-rw-r--r--t/chainlint.sed4
1 files changed, 2 insertions, 2 deletions
diff --git a/t/chainlint.sed b/t/chainlint.sed
index 883a2b307c..60c2099c18 100644
--- a/t/chainlint.sed
+++ b/t/chainlint.sed
@@ -126,7 +126,7 @@ b
# "&&" (but not ";" in a string)
:oneline
/;/{
- /"[^"]*;[^"]*"/!s/^/?!SEMI?!/
+ /"[^"]*;[^"]*"/!s/;/; ?!SEMI?!/
}
b
@@ -230,7 +230,7 @@ s/.*\n//
# string and not ";;" in one-liner "case...esac")
/;/{
/;;/!{
- /"[^"]*;[^"]*"/!s/^/?!SEMI?!/
+ /"[^"]*;[^"]*"/!s/;/; ?!SEMI?!/
}
}
# line ends with pipe "...|" -- valid; not missing "&&"