Git fork

chainlint: reduce annotation noise-factor

When chainlint detects a problem in a test definition, it highlights the
offending code with a "?!...?!" annotation. The rather curious "?!"
decoration was chosen to draw the reader's attention to the problem area
and to act as a good "needle" when using the terminal's search feature
to "jump" to the next problem.

Later, chainlint learned to color its output when sent to a terminal.
Problem annotations are colored with a red background which stands out
well from surrounding text, thus easily draws the reader's attention.
Together with the preceding change which gave all problem annotations a
uniform "LINT:" prefix, the noisy "?!" decoration has become superfluous
as a search "needle" so omit it when output is colored.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

authored by

Eric Sunshine and committed by
Junio C Hamano
a13ff419 e44f15ba

+3 -2
+2 -1
t/chainlint.pl
··· 651 651 $self->{nerrs} += @$problems; 652 652 return unless $emit_all || @$problems; 653 653 my $c = main::fd_colors(1); 654 + my ($erropen, $errclose) = -t 1 ? ("$c->{rev}$c->{red}", $c->{reset}) : ('?!', '?!'); 654 655 my $start = 0; 655 656 my $checked = ''; 656 657 for (sort {$a->[1]->[2] <=> $b->[1]->[2]} @$problems) { ··· 659 660 my $err = format_problem($label); 660 661 $checked .= substr($body, $start, $pos - $start); 661 662 $checked .= ' ' unless $checked =~ /\s$/; 662 - $checked .= "$c->{rev}$c->{red}?!LINT: $err?!$c->{reset}"; 663 + $checked .= "${erropen}LINT: $err$errclose"; 663 664 $checked .= ' ' unless $pos >= length($body) || 664 665 substr($body, $pos, 1) =~ /^\s/; 665 666 $start = $pos;
+1 -1
t/test-lib.sh
··· 1606 1606 test "${GIT_TEST_EXT_CHAIN_LINT:-1}" != 0 1607 1607 then 1608 1608 "$PERL_PATH" "$TEST_DIRECTORY/chainlint.pl" "$0" || 1609 - BUG "lint error (see '?!...!? annotations above)" 1609 + BUG "lint error (see 'LINT' annotations above)" 1610 1610 fi 1611 1611 1612 1612 # Last-minute variable setup