提交 a345fa37 编写于 作者: P Paul Yang 提交者: Dr. Matthias St. Pierre

Add section order check in util/find-doc-nits

This patch checks if the EXAMPLES section in a pod file is placed
before the RETURN VALUES section.
Reviewed-by: NRichard Levitte <levitte@openssl.org>

(cherry picked from commit cc838ee2d66f7295bf7a7e6695aab1080d6791e9)
Reviewed-by: NMatt Caswell <matt@openssl.org>
Reviewed-by: NMatthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
(Merged from https://github.com/openssl/openssl/pull/8736)
上级 d090fc00
......@@ -137,6 +137,18 @@ sub name_synopsis()
}
}
# Check if EXAMPLES is located after RETURN VALUES section.
sub check_example_location()
{
my $filename = shift;
my $contents = shift;
return unless $contents =~ /=head1 RETURN VALUES/
and $contents =~ /=head1 EXAMPLES/;
print "$filename: RETURN VAULES should be placed before EXAMPLES section\n"
if $contents =~ /=head1 EXAMPLES.*=head1 RETURN VALUES/ms;
}
sub check()
{
my $filename = shift;
......@@ -150,6 +162,8 @@ sub check()
close POD;
}
&check_example_location($filename, $contents) if $filename =~ m|man3/|;
my $id = "${filename}:1:";
&name_synopsis($id, $filename, $contents)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册