diff options
author | Eric Sunshine <sunshine@sunshineco.com> | 2018-08-13 08:47:35 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-08-13 19:22:11 (GMT) |
commit | 7e32a31b2101c3ced65ea9367c747930a4eb39d9 (patch) | |
tree | 86893d053f76b38cef1056130bbfad77999847ae /t/chainlint | |
parent | c2c29cc03e0d8156095dd18e2f7dcb768253c61a (diff) | |
download | git-7e32a31b2101c3ced65ea9367c747930a4eb39d9.zip git-7e32a31b2101c3ced65ea9367c747930a4eb39d9.tar.gz git-7e32a31b2101c3ced65ea9367c747930a4eb39d9.tar.bz2 |
chainlint: match 'quoted' here-doc tags
A here-doc tag can be quoted ('EOF') or escaped (\EOF) to suppress
interpolation within the body. Although, chainlint recognizes escaped
tags, it does not know about quoted tags. For completeness, teach it to
recognize 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 33bc3cc..aff6568 100644 --- a/t/chainlint/here-doc.expect +++ b/t/chainlint/here-doc.expect @@ -2,4 +2,6 @@ boodle wobba gorgo snoot wafta snurb && cat >foo && +cat >bar && + horticulture diff --git a/t/chainlint/here-doc.test b/t/chainlint/here-doc.test index 8986eef..f2bb14b 100644 --- a/t/chainlint/here-doc.test +++ b/t/chainlint/here-doc.test @@ -14,6 +14,13 @@ boz woz Arbitrary_Tag_42 +# LINT: swallow 'quoted' here-doc +cat <<'FUMP' >bar && +snoz +boz +woz +FUMP + # 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 7c2da63..7663ea7 100644 --- a/t/chainlint/subshell-here-doc.expect +++ b/t/chainlint/subshell-here-doc.expect @@ -5,5 +5,6 @@ >) && ( cat >bup && + cat >bup2 && meep >) diff --git a/t/chainlint/subshell-here-doc.test b/t/chainlint/subshell-here-doc.test index 05139af..b6b5a9b 100644 --- a/t/chainlint/subshell-here-doc.test +++ b/t/chainlint/subshell-here-doc.test @@ -27,5 +27,9 @@ glink FIZZ ARBITRARY + cat <<-'ARBITRARY2' >bup2 && + glink + FIZZ + ARBITRARY2 meep ) |