Re: [PATCH 29/29] t/test-lib: teach --chain-lint to detect broken &&-chains in subshells
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Jun 26, 2018, 20:59 UTC
- Message-ID
- <CAPig+cR1Jxdo_YGSCQRyFD4AMq2wrBzpESHhHkjTEnVG1mMRbQ@mail.gmail.com>
- In-Reply-To
- <20180626202244.GB2341@sigill.intra.peff.net>
On Tue, Jun 26, 2018 at 4:22 PM Jeff King <peff@peff.net> wrote:
Show 8 quoted lines
> So obviously that means "I don't think there's a good solution with this > approach". > > That whole final patch simultaneously impresses and nauseates me. Your > commit message says "no attempt is made at properly parsing shell code", > but we come pretty darn close. I almost wonder if we'd be better off > just parsing some heuristic subset and making sure (via review or > linting) that our tests conform.
I'm not sure I agree with "come pretty darn close", but your idea is an interesting one. It would sidestep the concern with "rm -fr" and friends (though it will probably still nauseate you). Let me cogitate about it a bit...
> Another option is to not enable this slightly-more-dangerous linting by > default. But that would probably rob it of its usefulness, since it > would just fall to some brave soul to later crank up the linting and fix > everybody else's mistakes.
I considered that, as well, and came to the same conclusion.