From db8c7a1cc02e545dd75b55e2ccbab2de51cd06ae Mon Sep 17 00:00:00 2001 From: Eric Sunshine Date: Mon, 13 Dec 2021 01:30:50 -0500 Subject: chainlint.sed: improve ?!AMP?! placement accuracy When chainlint.sed detects a broken &&-chain, it places an ?!AMP?! 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 ?!AMP?! annotation to the end of the line in order to better direct the programmer's attention to the source of the problem. Signed-off-by: Eric Sunshine Signed-off-by: Junio C Hamano --- t/chainlint/if-in-loop.expect | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 't/chainlint/if-in-loop.expect') diff --git a/t/chainlint/if-in-loop.expect b/t/chainlint/if-in-loop.expect index 03d3ceb22d..7d91837269 100644 --- a/t/chainlint/if-in-loop.expect +++ b/t/chainlint/if-in-loop.expect @@ -3,10 +3,10 @@ do if false then -?!AMP?! echo "err" + echo "err" ?!AMP?! exit 1 -?!AMP?! fi + fi ?!AMP?! foo -?!AMP?! done + done ?!AMP?! bar >) -- cgit v1.2.3 From 5be30d0cd301f50e5f4dd992bc11ce75f457cf46 Mon Sep 17 00:00:00 2001 From: Eric Sunshine Date: Mon, 13 Dec 2021 01:30:54 -0500 Subject: chainlint.sed: drop subshell-closing ">" annotation chainlint.sed inserts a ">" annotation at the beginning of a line to signal that its heuristics have identified an end-of-subshell. This was useful as a debugging aid during development of the script, but it has no value to test writers and might even confuse them into thinking that the linter is misbehaving by inserting line-noise into the shell code it is validating. Moreover, its presence also potentially makes it difficult to reuse the chainlint self-test "expect" output should a more capable linter ever be developed. Therefore, drop the ">" annotation. Signed-off-by: Eric Sunshine Signed-off-by: Junio C Hamano --- t/chainlint/if-in-loop.expect | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 't/chainlint/if-in-loop.expect') diff --git a/t/chainlint/if-in-loop.expect b/t/chainlint/if-in-loop.expect index 7d91837269..03b82a3e58 100644 --- a/t/chainlint/if-in-loop.expect +++ b/t/chainlint/if-in-loop.expect @@ -9,4 +9,4 @@ foo done ?!AMP?! bar ->) +) -- cgit v1.2.3