@@ -3479,47 +3479,47 @@ sub process {
3479
3479
# Kconfig supports named choices), so use a word boundary
3480
3480
# (\b) rather than a whitespace character (\s)
3481
3481
$line =~ / ^\+\s *(?:config|menuconfig|choice)\b / ) {
3482
- my $length = 0;
3483
- my $cnt = $realcnt ;
3484
- my $ln = $linenr + 1;
3485
- my $f ;
3486
- my $is_start = 0;
3487
- my $is_end = 0;
3488
- for (; $cnt > 0 && defined $lines [$ln - 1]; $ln ++) {
3489
- $f = $lines [$ln - 1];
3490
- $cnt -- if ($lines [$ln - 1] !~ / ^-/ );
3491
- $is_end = $lines [$ln - 1] =~ / ^\+ / ;
3482
+ my $ln = $linenr ;
3483
+ my $needs_help = 0;
3484
+ my $has_help = 0;
3485
+ my $help_length = 0;
3486
+ while (defined $lines [$ln ]) {
3487
+ my $f = $lines [$ln ++];
3492
3488
3493
3489
next if ($f =~ / ^-/ );
3494
- last if (! $file && $f = ~ / ^\@\@ / );
3490
+ last if ($f ! ~ / ^[ \+ ] / ); # !patch context
3495
3491
3496
- if ($lines [$ln - 1] =~ / ^\+\s *(?:bool|tristate|prompt)\s *["']/ ) {
3497
- $is_start = 1;
3498
- } elsif ($lines [$ln - 1] =~ / ^\+\s *(?:---)?help(?:---)?$ / ) {
3499
- $length = -1;
3492
+ if ($f =~ / ^\+\s *(?:bool|tristate|prompt)\s *["']/ ) {
3493
+ $needs_help = 1;
3494
+ next ;
3495
+ }
3496
+ if ($f =~ / ^\+\s *help\s *$ / ) {
3497
+ $has_help = 1;
3498
+ next ;
3500
3499
}
3501
3500
3502
- $f =~ s / ^.// ;
3503
- $f =~ s / #.*// ;
3504
- $f =~ s / ^\s +// ;
3505
- next if ($f =~ / ^$ / );
3501
+ $f =~ s / ^.// ; # strip patch context [+ ]
3502
+ $f =~ s / #.*// ; # strip # directives
3503
+ $f =~ s / ^\s +// ; # strip leading blanks
3504
+ next if ($f =~ / ^$ / ); # skip blank lines
3506
3505
3506
+ # At the end of this Kconfig block:
3507
3507
# This only checks context lines in the patch
3508
3508
# and so hopefully shouldn't trigger false
3509
3509
# positives, even though some of these are
3510
3510
# common words in help texts
3511
- if ($f =~ / ^\s *(?:config|menuconfig|choice|endchoice|
3512
- if|endif|menu|endmenu|source)\b /x ) {
3513
- $is_end = 1;
3511
+ if ($f =~ / ^(?:config|menuconfig|choice|endchoice|
3512
+ if|endif|menu|endmenu|source)\b /x ) {
3514
3513
last ;
3515
3514
}
3516
- $length ++ ;
3515
+ $help_length ++ if ( $has_help ) ;
3517
3516
}
3518
- if ($is_start && $is_end && $length < $min_conf_desc_length ) {
3517
+ if ($needs_help &&
3518
+ $help_length < $min_conf_desc_length ) {
3519
+ my $stat_real = get_stat_real($linenr , $ln - 1);
3519
3520
WARN(" CONFIG_DESCRIPTION" ,
3520
- " please write a paragraph that describes the config symbol fully \n " . $herecurr );
3521
+ " please write a help paragraph that fully describes the config symbol\n " . " $here \n $stat_real \n " );
3521
3522
}
3522
- # print "is_start<$is_start> is_end<$is_end> length<$length>\n";
3523
3523
}
3524
3524
3525
3525
# check MAINTAINERS entries
0 commit comments