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

[PATCH 0/4] chainlint: improve annotated output

From
Eric Sunshine via GitGitGadget <gitgitgadget@gmail.com>
Date
Nov 8, 2022, 19:08 UTC
Message-ID
<pull.1375.git.git.1667934510.gitgitgadget@gmail.com>

When chainlint detects problems in a test, such as a broken &&-chain, it prints out the test with "?!FOO?!" annotations inserted at each problem location. However, rather than annotating the original test definition, it instead dumps out a parsed token representation of the test. Since it lacks comments, indentation, here-doc bodies, and so forth, this tokenized representation can be difficult for the test author to digest and relate back to the original test definition.

An earlier patch series[1] improved the output somewhat by colorizing the "?!FOO?!" annotations and the "# chainlint:" lines, but the output can still be difficult to digest.

This patch series further improves the output by instead making chainlint.pl annotate the original test definition rather than the parsed token stream, thus preserving indentation (and whitespace, in general), here-doc bodies, etc., which should make it easier for a test author to relate each problem back to the source.

This series was inspired by usability comments from Peff[2] and Ævar[3] and a bit of discussion which followed[4][5].

(Note to self: Add Ævar to nerd-snipe blacklist alongside Peff.)
FOOTNOTES

[1] https://lore.kernel.org/git/pull.1324.v2.git.git.1663041707260.gitgitgadget@gmail.com/ [2] https://lore.kernel.org/git/Yx1x5lme2SGBjfia@coredump.intra.peff.net/ [3] https://lore.kernel.org/git/221024.865yg9ecsx.gmgdl@evledraar.gmail.com/ [4] https://lore.kernel.org/git/CAPig+cRJVn-mbA6-jOmNfDJtK_nX4ZTw+OcNShvvz8zcQYbCHQ@mail.gmail.com/ [5] https://lore.kernel.org/git/CAPig+cT=cWYT6kicNWT+6RxfiKKMyVz72H3_9kwkF-f4Vuoe1w@mail.gmail.com/

Eric Sunshine (4):
  chainlint: add explanatory comments
  chainlint: tighten accuracy when consuming input stream
  chainlint: latch start/end position of each token
  chainlint: annotate original test definition rather than token stream
 t/chainlint.pl                                | 107 +++++++++++-------
 t/chainlint/block-comment.expect              |   2 +
 t/chainlint/case-comment.expect               |   3 +
 t/chainlint/close-subshell.expect             |   3 +-
 t/chainlint/comment.expect                    |   4 +
 t/chainlint/double-here-doc.expect            |  14 ++-
 t/chainlint/empty-here-doc.expect             |   3 +-
 t/chainlint/for-loop.expect                   |   4 +-
 t/chainlint/here-doc-close-subshell.expect    |   4 +-
 t/chainlint/here-doc-indent-operator.expect   |  10 +-
 .../here-doc-multi-line-command-subst.expect  |   5 +-
 t/chainlint/here-doc-multi-line-string.expect |   4 +-
 t/chainlint/here-doc.expect                   |  24 +++-
 t/chainlint/if-then-else.expect               |   4 +-
 t/chainlint/incomplete-line.expect            |  10 +-
 t/chainlint/inline-comment.expect             |   4 +-
 t/chainlint/loop-detect-status.expect         |   2 +-
 t/chainlint/nested-here-doc.expect            |  27 ++++-
 t/chainlint/nested-subshell-comment.expect    |   2 +
 t/chainlint/subshell-here-doc.expect          |  28 ++++-
 t/chainlint/t7900-subtree.expect              |   4 +
 t/chainlint/while-loop.expect                 |   4 +-
 22 files changed, 206 insertions(+), 66 deletions(-)
base-commit: 63bba4fdd86d80ef061c449daa97a981a9be0792
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1375%2Fsunshineco%2Fchainlintpreserve-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1375/sunshineco/chainlintpreserve-v1
Pull-Request: https://github.com/git/git/pull/1375
-- 
gitgitgadget
Next: Eric Sunshine via GitGitGadget
Message 1 of 11 in “chainlint: improve annotated output”
  1. 0/4 chainlint: improve annotated outputEric Sunshine via GitGitGadget, Nov 8, 2022
  2. 1/4 chainlint: add explanatory commentsEric Sunshine via GitGitGadget, Nov 8, 2022
  3. 2/4 chainlint: tighten accuracy when consuming input streamEric Sunshine via GitGitGadget, Nov 8, 2022
  4. 3/4 chainlint: latch start/end position of each tokenEric Sunshine via GitGitGadget, Nov 8, 2022
  5. 4/4 chainlint: annotate original test definition rather than token streamEric Sunshine via GitGitGadget, Nov 8, 2022
  6. Taylor BlauNov 8, 2022
  7. Jeff KingNov 9, 2022
  8. Taylor BlauNov 10, 2022
  9. Ævar Arnfjörð BjarmasonNov 8, 2022
  10. Eric SunshineNov 8, 2022
  11. Eric SunshineNov 8, 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.