Skip to content

Commit

Permalink
Enable find-doc-nits to find undocumented symbols since 1.1.1
Browse files Browse the repository at this point in the history
A previous commit added the ability to find newly undocumented symbols.
We extend this capability to check anything that was newly added since
1.1.1 which is undocumented. A new option -o is added to find-doc-nits
to amend the behaviour of -v or -e to check symbols that were newly
added since the release of 1.1.1.

Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from #9094)
  • Loading branch information
mattcaswell committed Jun 12, 2019
1 parent 8caab50 commit a03749a
Show file tree
Hide file tree
Showing 4 changed files with 1,922 additions and 6 deletions.
26 changes: 20 additions & 6 deletions util/find-doc-nits
Expand Up @@ -22,6 +22,7 @@ use OpenSSL::Util::Pod;
our($opt_d);
our($opt_e);
our($opt_s);
our($opt_o);
our($opt_h);
our($opt_l);
our($opt_n);
Expand All @@ -37,6 +38,7 @@ Find small errors (nits) in documentation. Options:
-d Detailed list of undocumented (implies -u)
-e Detailed list of new undocumented (implies -v)
-s Same as -e except no output is generated if nothing is undocumented
-o Causes -e/-v to count symbols added since 1.1.1 as new (implies -v)
-l Print bogus links
-n Print nits in POD pages
-p Warn if non-public name documented (implies -n)
Expand Down Expand Up @@ -318,8 +320,13 @@ sub checkmacros()
{
my $count = 0;
my %seen;
my @missing;

my @missing = loadmissing('util/missingmacro.txt') if ($opt_v);
if ($opt_o) {
@missing = loadmissing('util/missingmacro111.txt');
} elsif ($opt_v) {
@missing = loadmissing('util/missingmacro.txt');
}

print "# Checking macros (approximate)\n" if !$opt_s;
foreach my $f ( glob('include/openssl/*.h') ) {
Expand Down Expand Up @@ -538,19 +545,21 @@ sub checkflags() {
return $ok;
}

getopts('cdeslnphuv');
getopts('cdesolnphuv');

&help() if $opt_h;

$opt_n = 1 if $opt_p;
$opt_u = 1 if $opt_d;
$opt_e = 1 if $opt_s;
$opt_v = 1 if $opt_e;
$opt_v = 1 if $opt_o || $opt_e;

die "Cannot use both -u and -v" if $opt_u && $opt_v;
die "Cannot use both -d and -e" if $opt_d && $opt_e;

die "Need one of -[cdelnpuv] flags.\n"
# We only need to check c, l, n, u and v.
# Options d, e, s, o and p imply one of the above.
die "Need one of -[cdesolnpuv] flags.\n"
unless $opt_c or $opt_l or $opt_n or $opt_u or $opt_v;

if ( $opt_c ) {
Expand Down Expand Up @@ -617,8 +626,13 @@ if ( $opt_u || $opt_v) {
foreach ( keys %temp ) {
$docced{$_} = $temp{$_};
}
&printem('crypto', 'util/libcrypto.num', 'util/missingcrypto.txt');
&printem('ssl', 'util/libssl.num', 'util/missingssl.txt');
if ($opt_o) {
&printem('crypto', 'util/libcrypto.num', 'util/missingcrypto111.txt');
&printem('ssl', 'util/libssl.num', 'util/missingssl111.txt');
} else {
&printem('crypto', 'util/libcrypto.num', 'util/missingcrypto.txt');
&printem('ssl', 'util/libssl.num', 'util/missingssl.txt');
}
&checkmacros();
}

Expand Down

0 comments on commit a03749a

Please sign in to comment.