summaryrefslogtreecommitdiffstats
path: root/util/find-doc-nits
diff options
context:
space:
mode:
authorPaul Yang <yang.yang@baishancloud.com>2019-02-26 13:51:02 +0800
committerPaul Yang <yang.yang@baishancloud.com>2019-02-28 21:38:20 +0800
commitcc838ee2d66f7295bf7a7e6695aab1080d6791e9 (patch)
tree4431212be674e1f62b9ad5d0f63b3e16b8f5cd26 /util/find-doc-nits
parent4564e77ae9dd1866e8a033f03511b6a1792c024e (diff)
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: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8338)
Diffstat (limited to 'util/find-doc-nits')
-rwxr-xr-xutil/find-doc-nits14
1 files changed, 14 insertions, 0 deletions
diff --git a/util/find-doc-nits b/util/find-doc-nits
index a8cea9c5e0..5d5c2d05b2 100755
--- a/util/find-doc-nits
+++ b/util/find-doc-nits
@@ -142,6 +142,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;
@@ -155,6 +167,8 @@ sub check()
close POD;
}
+ &check_example_location($filename, $contents) if $filename =~ m|man3/|;
+
my $id = "${filename}:1:";
&name_synopsis($id, $filename, $contents)