summaryrefslogtreecommitdiff
path: root/t/chainlint.sed
diff options
context:
space:
mode:
authorEric Sunshine <sunshine@sunshineco.com>2018-08-29 09:45:32 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-08-29 17:57:38 (GMT)
commit3042b6bb59787613e36e459bf60994a26bb5a5df (patch)
tree33e4e502498f304e2cc861dd37d22c3970d9f668 /t/chainlint.sed
parent4f69176feb1b441d46dab7a0ac679df7edf44f5f (diff)
downloadgit-3042b6bb59787613e36e459bf60994a26bb5a5df.zip
git-3042b6bb59787613e36e459bf60994a26bb5a5df.tar.gz
git-3042b6bb59787613e36e459bf60994a26bb5a5df.tar.bz2
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.sed')
-rw-r--r--t/chainlint.sed8
1 files changed, 4 insertions, 4 deletions
diff --git a/t/chainlint.sed b/t/chainlint.sed
index 8544df3..1da58b5 100644
--- a/t/chainlint.sed
+++ b/t/chainlint.sed
@@ -94,8 +94,8 @@
# here-doc -- swallow it to avoid false hits within its body (but keep the
# command to which it was attached)
-/<<[ ]*[-\\']*[A-Za-z0-9_]/ {
- s/^\(.*\)<<[ ]*[-\\']*\([A-Za-z0-9_][A-Za-z0-9_]*\)'*/<\2>\1<</
+/<<[ ]*[-\\'"]*[A-Za-z0-9_]/ {
+ s/^\(.*\)<<[ ]*[-\\'"]*\([A-Za-z0-9_][A-Za-z0-9_]*\)['"]*/<\2>\1<</
s/[ ]*<<//
:hereslurp
N
@@ -159,7 +159,7 @@ s/.*\n//
}
:folded
# here-doc -- swallow it
-/<<[ ]*[-\\']*[A-Za-z0-9_]/bheredoc
+/<<[ ]*[-\\'"]*[A-Za-z0-9_]/bheredoc
# comment or empty line -- discard since final non-comment, non-empty line
# before closing ")", "done", "elsif", "else", or "fi" will need to be
# re-visited to drop "suspect" marking since final line of those constructs
@@ -281,7 +281,7 @@ bfolded
# found here-doc -- swallow it to avoid false hits within its body (but keep
# the command to which it was attached)
:heredoc
-s/^\(.*\)<<[ ]*[-\\']*\([A-Za-z0-9_][A-Za-z0-9_]*\)'*/<\2>\1<</
+s/^\(.*\)<<[ ]*[-\\'"]*\([A-Za-z0-9_][A-Za-z0-9_]*\)['"]*/<\2>\1<</
s/[ ]*<<//
:hereslurpsub
N