From 60a7817cacacf4b30a16414479789c2774360782 Mon Sep 17 00:00:00 2001 From: Rich Salz Date: Wed, 25 Sep 2019 15:39:03 -0400 Subject: [PATCH] Add wordlist from man7.org Reviewed-by: Richard Levitte Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/10023) --- util/find-doc-nits | 55 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/util/find-doc-nits b/util/find-doc-nits index 9c5826d05f..abb7750b12 100755 --- a/util/find-doc-nits +++ b/util/find-doc-nits @@ -349,6 +349,59 @@ sub functionname_check { # with a variable part (typically marked up as B_bar> } +# This is from http://man7.org/linux/man-pages/man7/man-pages.7.html +my %preferred_words = ( + 'bitmask' => 'bit mask', + 'builtin' => 'built-in', + #'epoch' => 'Epoch', # handled specially, below + 'file name' => 'filename', + 'file system' => 'filesystem', + 'host name' => 'hostname', + 'i-node' => 'inode', + 'lower case' => 'lowercase', + 'lower-case' => 'lowercase', + 'non-zero' => 'nonzero', + 'path name' => 'pathname', + 'pseudo-terminal' => 'pseudoterminal', + 'reserved port' => 'privileged port', + 'system port' => 'privileged port', + 'realtime' => 'real-time', + 'real time' => 'real-time', + 'runtime' => 'run time', + 'saved group ID'=> 'saved set-group-ID', + 'saved set-GID' => 'saved set-group-ID', + 'saved user ID' => 'saved set-user-ID', + 'saved set-UID' => 'saved set-user-ID', + 'set-GID' => 'set-group-ID', + 'setgid' => 'set-group-ID', + 'set-UID' => 'set-user-ID', + 'setuid' => 'set-user-ID', + 'super user' => 'superuser', + 'super-user' => 'superuser', + 'super block' => 'superblock', + 'super-block' => 'superblock', + 'time stamp' => 'timestamp', + 'time zone' => 'timezone', + 'upper case' => 'uppercase', + 'upper-case' => 'uppercase', + 'useable' => 'usable', + 'userspace' => 'user space', + 'user name' => 'username', + 'zeroes' => 'zeros' +); + +sub wording { + my $id = shift; + my $contents = shift; + + foreach my $k ( keys %preferred_words ) { + err($id, "found '$k' should use '$preferred_words{$k}'") + if $contents =~ /\b\Q$k\E\b/i; + } + err($id, "found 'epoch' should use 'Epoch'") + if $contents =~ /\bepoch\b/; +} + sub check { my $filename = shift; my $dirname = basename(dirname($filename)); @@ -380,6 +433,8 @@ sub check { } } + wording($id, $contents); + err($id, "doesn't start with =pod") if $contents !~ /^=pod/; err($id, "doesn't end with =cut") -- 2.25.1