Re: [PATCH 1/3] chainlint.pl: fix line number reporting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jul 08, 2024 at 01:08:02AM -0400, Eric Sunshine wrote:

> > I actually suspect the "record the heredoc line number" thing would not
> > be too hard. I.e., turn ShellParser's "heredoc" hash to point to
> > hashrefs like: "{ content => ..., lineno => ... }". And that would give
> > us a good spot to stick an "interpolate" boolean later if we want.
> 
> It turned out to be quite easy. See below for an implementation atop
> your patch [1/3] (modulo Gmail whitespace damage). Given how simple
> this ended up being, it probably makes sense to squash this change in,
> as well.

Very nice! I was hoping it would be something like this. I've squashed
this in, and confirmed that it fixes the line numbers in my "double"
case:

  test_expect_success "$(cat <<END_OF_PREREQS)" 'here-doc-double' - <<\EOT
  SOME
  PREREQS
  END_OF_PREREQS
  	echo "actual test commands"
  	echo "that should be checked"
  EOT

The bogus line was incorrectly reported as line 2, because we did not
account for the first here-doc.

-Peff




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux