summaryrefslogtreecommitdiff
path: root/bundle.h
diff options
context:
space:
mode:
authorEric Sunshine <sunshine@sunshineco.com>2022-09-13 04:01:47 (GMT)
committerJunio C Hamano <gitster@pobox.com>2022-09-13 04:33:58 (GMT)
commit7c04aa73906b9186c9d46010227d4437fd534d93 (patch)
treec44823a497339e56c7d01c199a8939cb278c18ff /bundle.h
parentfb41727b7ed7f62d121cd846f826fb1c62d1bc6a (diff)
downloadgit-7c04aa73906b9186c9d46010227d4437fd534d93.zip
git-7c04aa73906b9186c9d46010227d4437fd534d93.tar.gz
git-7c04aa73906b9186c9d46010227d4437fd534d93.tar.bz2
chainlint: colorize problem annotations and test delimiters
When `chainlint.pl` detects problems in a test definition, it emits the test definition with "?!FOO?!" annotations highlighting the problems it discovered. For instance, given this problematic test: test_expect_success 'discombobulate frobnitz' ' git frob babble && (echo balderdash; echo gnabgib) >expect && for i in three two one do git nitfol $i done >actual test_cmp expect actual ' chainlint.pl will output: # chainlint: t1234-confusing.sh # chainlint: discombobulate frobnitz git frob babble && (echo balderdash ; ?!AMP?! echo gnabgib) >expect && for i in three two one do git nitfol $i ?!LOOP?! done >actual ?!AMP?! test_cmp expect actual in which it may be difficult to spot the "?!FOO?!" annotations. The problem is compounded when multiple tests, possibly in multiple scripts, fail "linting", in which case it may be difficult to spot the "# chainlint:" lines which delimit one problematic test from another. To ameliorate this potential problem, colorize the "?!FOO?!" annotations in order to quickly draw the test author's attention to the problem spots, and colorize the "# chainlint:" lines to help the author identify the name of each script and each problematic test. Colorization is disabled automatically if output is not directed to a terminal or if NO_COLOR environment variable is set. The implementation is specific to Unix (it employs `tput` if available) but works equally well in the Git for Windows development environment which emulates Unix sufficiently. Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'bundle.h')
0 files changed, 0 insertions, 0 deletions