diff options
author | Eric Sunshine <sunshine@sunshineco.com> | 2018-08-29 05:45:32 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-08-29 10:57:38 -0700 |
commit | 3042b6bb59787613e36e459bf60994a26bb5a5df (patch) | |
tree | 33e4e502498f304e2cc861dd37d22c3970d9f668 /t/chainlint | |
parent | chainlint: add test of pathological case which triggered false positive (diff) | |
download | tgif-3042b6bb59787613e36e459bf60994a26bb5a5df.tar.xz |
chainlint: match "quoted" here-doc tags
A here-doc tag can be quoted ('EOF'/"EOF") or escaped (\EOF) to suppress
interpolation within the body. chainlint recognizes single-quoted and
escaped tags, but does not know about double-quoted tags. For
completeness, teach it to recognize double-quoted tags, as well.
Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/chainlint')
-rw-r--r-- | t/chainlint/here-doc.expect | 2 | ||||
-rw-r--r-- | t/chainlint/here-doc.test | 7 | ||||
-rw-r--r-- | t/chainlint/subshell-here-doc.expect | 1 | ||||
-rw-r--r-- | t/chainlint/subshell-here-doc.test | 4 |
4 files changed, 14 insertions, 0 deletions
diff --git a/t/chainlint/here-doc.expect b/t/chainlint/here-doc.expect index aff6568716..534b065e38 100644 --- a/t/chainlint/here-doc.expect +++ b/t/chainlint/here-doc.expect @@ -4,4 +4,6 @@ cat >foo && cat >bar && +cat >boo && + horticulture diff --git a/t/chainlint/here-doc.test b/t/chainlint/here-doc.test index f2bb14b693..ad4ce8afd9 100644 --- a/t/chainlint/here-doc.test +++ b/t/chainlint/here-doc.test @@ -21,6 +21,13 @@ boz woz FUMP +# LINT: swallow "quoted" here-doc +cat <<"zump" >boo && +snoz +boz +woz +zump + # LINT: swallow here-doc (EOF is last line of test) horticulture <<\EOF gomez diff --git a/t/chainlint/subshell-here-doc.expect b/t/chainlint/subshell-here-doc.expect index 7663ea7fc4..74723e7340 100644 --- a/t/chainlint/subshell-here-doc.expect +++ b/t/chainlint/subshell-here-doc.expect @@ -6,5 +6,6 @@ ( cat >bup && cat >bup2 && + cat >bup3 && meep >) diff --git a/t/chainlint/subshell-here-doc.test b/t/chainlint/subshell-here-doc.test index b6b5a9b33a..f6b3ba4214 100644 --- a/t/chainlint/subshell-here-doc.test +++ b/t/chainlint/subshell-here-doc.test @@ -31,5 +31,9 @@ glink FIZZ ARBITRARY2 + cat <<-"ARBITRARY3" >bup3 && + glink + FIZZ + ARBITRARY3 meep ) |