Re: [PATCH v2 2/6] chainlint: match 'quoted' here-doc tags
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Aug 13, 2018, 20:12 UTC
- Message-ID
- <CAPig+cQNXiZ8MhapGGikB0bwO2Cm-YHFRbZice22opWTAEhwgw@mail.gmail.com>
- In-Reply-To
- <xmqqwosu3w4k.fsf@gitster-ct.c.googlers.com>
On Mon, Aug 13, 2018 at 3:27 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 10 quoted lines
> Eric Sunshine <sunshine@sunshineco.com> writes:
>
> > 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.
>
> Is this step merely completeness and future-proofing, or do we have
> existing instances that the linter would be confused without this
> patch?We do have quite a few instances of single-quoted 'EOF' in the tests already, though none of them confuse the linter, so this change is for completeness and future-proofing.
> I am primarily wondering what the reason is that <<"EOF" is > not looked for while we are at it (the answer could be that we > have tests that use <<'EOF' but not <<"EOF").
It's an oversight on my part. I've gotten so used to \EOF (and before working on Git, 'EOF'), that "EOF" just slipped my mind[1].
I do think it's worth a re-roll. Thanks for noticing.
[1]: What did not slip my mind is that quoting _any_ part of the tag suppresses interpolation, so 'E'OF, E'O'F, and even E''OF are all valid, however, that's so ugly that I really didn't want to support it.