git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: chainlint.pl's new "deparse" output (was: [PATCH v2] [...])

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Oct 25, 2022, 04:15 UTC
Message-ID
<CAPig+cQhsGpOa1XqfOj-zV1esc_uEkOPGg3hVUkSWrkVma+GNQ@mail.gmail.com>
In-Reply-To
<CAPig+cT=cWYT6kicNWT+6RxfiKKMyVz72H3_9kwkF-f4Vuoe1w@mail.gmail.com>
On Tue, Oct 25, 2022 at 12:05 AM Eric Sunshine <sunshine@sunshineco.com> wrote:
Show 16 quoted lines
> On Mon, Oct 24, 2022 at 6:28 AM Ævar Arnfjörð Bjarmason
> <avarab@gmail.com> wrote:
> > Another thing: When a test *ends* in a "&&" (common when you copy/paste
> > e.g. "test_cmp expect actual &&\n" from another test) it doesn't spot
> > it, but instead we get all the way to the eval/117, i.e. "broken
> > &&-chain or run-away HERE-DOC".
>
> Yes, I recall considering that case and others, but decided that
> that's probably outside the scope of the linter. [...]
>
> It is unfortunate, though, that the shell's "syntax error" output gets
> swallowed by the eval/117 checker in test-lib.sh and turned into a
> somewhat less useful message. I'm not quite sure how we can fix the
> eval/117 checker to not swallow genuine syntax errors like that,
> unless we perhaps specially recognize exit code 2 and, um, do
> something...

Another "fix" would be to drop the eval/117 checker altogether. I retained it as a final safeguard in case something slipped past chainlint.pl, however, I'm not sure how much value the eval/117 checker really has since it misses so many real-world cases, such as any &&-chain break in the body of a compound context (if/fi, case/esac, for/done, while/done, (...), {...}, $(...), etc.). Moreover, we see now that it's also obscuring useful error messages (such as "syntax error") from the shell itself. So, dropping it may be an option(?).

Previous: Eric SunshineNext: Ævar Arnfjörð Bjarmason
Message 17 of 18 in “chainlint: colorize problem annotations and test delimiters”
  1. chainlint: colorize problem annotations and test delimitersEric Sunshine via GitGitGadget, Sep 12, 2022
  2. Junio C HamanoSep 12, 2022
  3. Eric SunshineSep 13, 2022
  4. Junio C HamanoSep 13, 2022
  5. Eric SunshineSep 13, 2022
  6. Jeff KingSep 13, 2022
  7. Jeff KingSep 13, 2022
  8. Eric SunshineSep 13, 2022
  9. Jeff KingSep 13, 2022
  10. Jeff KingSep 13, 2022
  11. chainlint: colorize problem annotations and test delimitersEric Sunshine via GitGitGadget, Sep 13, 2022
  12. Jeff KingSep 13, 2022
  13. Junio C HamanoSep 13, 2022
  14. Ævar Arnfjörð BjarmasonOct 24, 2022
  15. chainlint.pl's new "deparse" output (was: [PATCH v2] [...])Ævar Arnfjörð Bjarmason, Oct 24, 2022
  16. Eric SunshineOct 25, 2022
  17. Eric SunshineOct 25, 2022
  18. Ævar Arnfjörð BjarmasonOct 25, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.