This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
U/perl/time_size.U: don't try to include non-standard <values.h>
[metaconfig.git] / U / spellcheck-U
CommitLineData
6092c506 1#!/usr/bin/perl
ed5d019e
MBT
2
3use 5.016;
4use warnings;
5use autodie;
6
7use File::Find;
65a32477 8
ed5d019e 9use Pod::Spell::CommonMistakes::WordList qw( _check_case _check_common );
65a32477 10use Text::Aspell;
ed5d019e
MBT
11
12my @u;
13find (sub { m/\.U$/ && !-l && -s and push @u, $File::Find::name }, glob "*");
14
15my %ignore = (
16 "modified/Oldconfig.U" => {
17 "gnu" => "GNU", # output of uname
18 },
19 "perl/patchlevel.U" => {
20 "subversion" => "Subversion", # perl's subversion, not svn
21 },
22 );
65a32477
MBT
23my %skip = map { m/^(\S+)/; lc $1 => 1 } <DATA>;
24if (open my $fh, "<", "/pro/3gl/CPAN/perl-git/Porting/Glossary") {
25 while (<$fh>) {
26 m/^(\S+)\s+\(\S+\)\s*:\s*$/ and $skip{lc $1}++;
27 }
28 }
29if (open my $fh, "<", "/pro/3gl/CPAN/perl-git/config_h.SH") {
30 while (<$fh>) {
31 m{^/\* ([A-Z_]+):$} and $skip{lc $1}++;
32 }
33 }
34
35my $asp = Text::Aspell->new;
ed5d019e
MBT
36
37foreach my $u (sort @u) {
38 open my $fh, "<", $u;
39
65a32477
MBT
40 my ($m) = ($u =~ m{([^/]+)\.U$});
41 $skip{lc $m}++;
42
ed5d019e
MBT
43 my $n = 0;
44 while (<$fh>) {
45
65a32477 46 my $loc = sprintf "%-27s %4d", $u, ++$n;
ed5d019e
MBT
47
48 m{^(?| \?RCS: \s+ (\w.*)
3cfe0f67 49 | \?C: \s+ (\w.*)
ed5d019e
MBT
50 | \?S: \s+ (\w.*)
51 | \?INIT:: \s+ (\w.*)
52 | \?X: \s* (\w.*)
53 | : \s+ (\w.*)
54 )}x or
65a32477
MBT
55 m{echo \s+ (?| "([^"]+)"
56 | '([^']+)'
57 )}x or next;
ed5d019e
MBT
58
59 my $t = $1;
3cfe0f67
MBT
60 $t =~ s/\b( [Ww]as
61 | [Dd]id
62 | [Ii]s
63 | [Cc]ould
64 | [Ss]hould
65 | [Dd]oes
66 | [Nn]eed
67 | [Aa]re
68 ) n't
69 \b/$1 not/gx;
65a32477
MBT
70 $t =~ s{\b[fh]tt?ps?://\S+}{}g; # possible url
71 $t =~ s{<\S+\@\S+>}{}g; # possible e-mail address
72 $t =~ s{<\S+\.h>}{}g; # possibly header file reference
73 $t =~ s{"\S+\.h"}{}g; # possibly header file reference
74
75 my @w = split m([!-#'-,./:-?[-^`{-~\s]+) => $t;
ed5d019e 76
65a32477 77 # CommonMistakes
ed5d019e
MBT
78 my ($err, %seen);
79 $err = _check_case (\@w);
80 if (ref $err eq "HASH" && keys %$err) {
81 for (sort keys %$err) {
82 exists $ignore{$u}{$_} and next;
83 $seen{$_}++ and next;;
65a32477 84 printf "%s %-20s => %s\n", $loc, $_, $err->{$_};
ed5d019e
MBT
85 }
86 }
87
88 $err = _check_common (\@w);
89 if (ref $err eq "HASH" && keys %$err) {
90 for (sort keys %$err) {
91 exists $ignore{$u}{$_} and next;
92 $seen{$_}++ and next;;
65a32477 93 printf "%s %-20s => %s\n", $loc, $_, $err->{$_};
ed5d019e
MBT
94 }
95 }
65a32477
MBT
96
97 # aspell
98 for (grep { !m/[-0-9_\$@%~]/ } @w) {
99 exists $ignore{$u}{$_} and next;
100 exists $skip{lc $_} and next;
101 $asp->check ($_) and next;
102 my @s = $asp->suggest ($_);
103 printf "%s %-20s => %s\n", $loc, $_, "(@s)";
104 }
ed5d019e
MBT
105 }
106 }
65a32477
MBT
107
108__END__
109abcdef
110accessx
111aintl
112aix
113alignedness
114andreas
115ansic
116archlibs
117arg
3cfe0f67 118argc
65a32477 119args
3cfe0f67 120argv
65a32477 121arrgh
3cfe0f67 122asctime
65a32477
MBT
123asm
124atof
125attrlist
126backquotes
3cfe0f67 127backslashitis
65a32477
MBT
128backticks
129basename
130basenames
3cfe0f67 131baz
65a32477
MBT
132bcopy
133bene
134bincompat
135bitness
136bourne
137braindead
138brand
139bsd
140bsdtypes
3cfe0f67 141buf
65a32477
MBT
142buglet
143builtin
144calloc
145canonicalize
146castneg
147catify
148cbu
149ccs
150cd
151cdpath
152ceil
153cflags
154charvsprintf
155chorusos
156chown
157cjk
158clearenv
159clib
160closedir
161cmd
162cmdline
163cmsghdr
164cnt
165conf
166config
167configpm
168const
169copysignl
170cposix
171css
172csym
3cfe0f67 173ctermid
65a32477 174cthreads
3cfe0f67 175ctime
65a32477
MBT
176ctype
177cygwin
178datatype
179dbm
180dbminit
181dec
3cfe0f67 182denormalized
65a32477
MBT
183dev
184dflt
185dg
3cfe0f67 186difftime
65a32477
MBT
187dir
188dirent
189dirfd
3cfe0f67 190dirname
65a32477 191dirnames
3cfe0f67 192dirstream
65a32477
MBT
193djgpp
194dl
195dld
196dll
197dlobj
198dlopen
199dlsym
200doughera
201dougherty
202drepper
203dst
204dwhatever
205dynaloader
206dynix
207eaccess
208edu
209elif
210emx
211emximp
212endgrent
213endhostent
214endian
215endif
216endnetent
217endprotoent
218endpwent
219endservent
220endspent
3cfe0f67 221enoent
65a32477
MBT
222enosys
223enum
224enums
225env
226eof
227eofpipe
228eom
229eot
3cfe0f67 230eqnchar
65a32477 231errno
3cfe0f67 232errnolistc
65a32477 233esac
3cfe0f67 234euid
65a32477
MBT
235eval
236evals
237exe
238executables
239extern
240extliblist
241extutils
242fallthrough
243fastread
244faststdio
245fchdir
246fcntl
247fd
248fflush
249fi
250fielnames
3cfe0f67 251fifos
65a32477
MBT
252filename
253filenames
254filesystem
3cfe0f67 255filesystems
65a32477
MBT
256finitel
257fiosnbio
3cfe0f67 258firstkey
65a32477
MBT
259fixme
260fn
261fndelay
3cfe0f67 262foo
65a32477
MBT
263fp
264fpa
265fpclass
266fpclassify
267fpclassl
268fprintf
269fread
270freebsd
271frexpl
272fseek
273fseeko
274fsetpos
3cfe0f67 275fstat
65a32477
MBT
276fstatfs
277fstatvfs
278fsync
279ftell
280ftello
281furuseth
282futimes
283fwrite
284gconvert
285gcvt
286gdbm
287getaddrinfo
288getc
289getcwd
290getdtablesize
291getespwnam
292getfile
293getfsstat
294getgid
295getgrent
3cfe0f67
MBT
296getgrgid
297getgrnam
65a32477
MBT
298gethost
299gethostbyaddr
300gethostbyname
301gethostent
302gethostname
303gethostxxx
304getitimer
3cfe0f67 305getlogin
65a32477
MBT
306getmnt
307getmntent
3cfe0f67 308getmntinfo
65a32477
MBT
309getnameinfo
310getnet
311getnetbyaddr
312getnetbyname
313getnetent
314getnetxxx
315getpagesize
316getpgrp
3cfe0f67 317getpos
65a32477 318getproto
3cfe0f67 319getprotobyaddr
65a32477
MBT
320getprotobyname
321getprotobynumber
322getprotoent
323getprotoxxx
324getprpwnam
3cfe0f67 325getpw
65a32477 326getpwent
3cfe0f67
MBT
327getpwnam
328getpwuid
65a32477 329getrlimit
3cfe0f67 330getrusage
65a32477
MBT
331getsbyname
332getsbyport
333getserv
3cfe0f67 334getservbyaddr
65a32477
MBT
335getservbyname
336getservbyport
337getservent
338getservxxx
339getspent
340getspnam
341getuid
342getvar
343gid
344gids
345glibc
346gmtime
347gnu
348gnulibc
349grp
350hallvard
3cfe0f67 351hardwire
65a32477
MBT
352hardwiring
353hasmntopt
354hdrs
355hexadecimal
356hietaniemi
357hmb
358hostname
359hpux
360html
361htonl
3cfe0f67 362htons
65a32477
MBT
363hup
364hurd
365iconv
366ieeefp
367ifdef
368ifndef
369ihdr
370ilogbl
371incpth
372incpush
3cfe0f67 373indices
65a32477
MBT
374inet
375inhdr
376init
377initprog
378inlibc
379inode
380inodes
381installdirs
382installlocalarch
383installlocallib
384installperl
385ints
386inttypes
387iovec
388ip
389ipc
3cfe0f67 390irix
65a32477
MBT
391is
392isascii
393isblank
394isc
395isdone
396isfinite
397isinf
398isnan
399isnanl
400ivs
401ix
402jaeger
403jarkko
404jhi
405joinable
406keepalive
407koenig
408korn
409k&r
410lafayette
411langinfo
412lchmod
413lchown
414ldopts
415lex
416libexec
417libexp
418libm
419libso
420libsocks
421libutil
422llseek
423loc
424localarchexp
425locallibexp
426localtime
427loclist
428login
429logname
3cfe0f67 430longjmp
65a32477
MBT
431longlong
432lookup
433lookups
434lorder
435lseek
436lst
437lutimes
438lvalue
439machten
440madvise
441makedist
442makefile
443makefiles
444makemaker
445malloc
446mandirstyle
447manfredi
448manoj
449mansrc
450memchr
451memcmp
452memcpy
453memmove
454merijn
455metaconfig
456metalint
457mips
458misconfigured
459mk
460mkdtemp
3cfe0f67 461mkfifo
65a32477
MBT
462mknod
463mkstemp
464mkstemps
3cfe0f67 465mktime
65a32477
MBT
466mman
467mmap
468mntent
469modfl
470monash
471morebits
472mpe
473mprotect
474mqueue
475msg
476msghdr
477msvc
478multiplatform
479myconfig
480myinit
481myread
3cfe0f67 482nan
65a32477 483nanosleep
3cfe0f67
MBT
484nanq
485nans
65a32477
MBT
486ndbm
487ndir
488netbsd
489netdb
490netdbtype
491netinet
492netinfo
493netwide
494neumann
495nevermind
496next
3cfe0f67 497nextkey
65a32477
MBT
498nfs
499nis
500nlist
501nofile
502nonnull
503nonxs
504noreturn
505nota
506nrand
507nsig
3cfe0f67
MBT
508ntohl
509ntohs
65a32477
MBT
510nvs
511nwc
512odbm
513ok
514okamoto
515oldconfig
516oldprefix
517oldsocket
518oldsyms
519opcode
520optdef
521os
522osf
523oslevel
3cfe0f67 524pagefull
65a32477
MBT
525pase
526passwd
527pathname
528pathnames
529pc
530perldoc
531perlio
532perlmain
533perly
534pgrp
535pid
536pids
537popen
538posix
539posixized
540posthint
541prctl
542prefixvar
543prepend
544prepended
545preprocess
546preprocessor
547printf
548prot
549pthread
550pthreads
551ptr
552ptx
553pvs
554pwd
555qgcvt
556qnx
3cfe0f67 557readdir
65a32477
MBT
558readv
559realloc
560realpath
561realsilent
3cfe0f67 562recompiles
65a32477
MBT
563recvmsg
564redhat
565reentr
566resolv
567ret
568rp
569rsrc
3cfe0f67 570ruid
65a32477
MBT
571runtime
572rusage
573sahlbach
574salzenberg
575sbin
576sbrk
577scalbnl
578scanf
579sched
580sco
581sdbm
582sem
583semctl
584semun
585sendmsg
3cfe0f67 586setgid
65a32477
MBT
587setgrent
588sethostent
589setitimer
590setjmp
3cfe0f67 591setlocale
65a32477
MBT
592setnetent
593setpgrp
3cfe0f67 594setpos
65a32477
MBT
595setproctitle
596setprotoent
597setpwent
598setresgid
599setresuid
3cfe0f67 600setrgid
65a32477
MBT
601setrlimit
602setservent
603setsockopt
604setspent
605setuid
606setvar
607setvbuf
608sfio
609sgi
610shlib
611shm
612shmat
613sig
614sigabrt
615sigaction
616sigarraysize
617sigiot
3cfe0f67 618siglongjmp
65a32477
MBT
619signbit
620signedchar
621signedness
622sigprocmask
623sigqueue
3cfe0f67 624sigquit
65a32477
MBT
625sigrtmax
626sigsetjmp
627sigstksize
628sigstksz
629sigtimedwait
630sigtyp
631sigwait
632sigwaitinfo
633sigxxx
634sigzero
635sitecustomize
636sitescriptdirexp
637sizeof
638skimo
639sl
640snprintf
641sockaddr
642sockatmark
643socketpair
644socklib
645solaris
646sony
647sprintf
648sqrtl
649srand
650srandom
651src
652srivastava
653statfs
654statvfs
655stdarg
656stdbool
657stderr
658stdin
659stdlib
660stdout
661strerror
662strftime
663stringification
3cfe0f67 664stringifies
65a32477
MBT
665strlcat
666strlcpy
3cfe0f67 667strlen
65a32477
MBT
668strptime
669strtold
670strtoll
671strtoq
672strtoul
673strtoull
674strtouq
675struct
676structs
677su
678subdirectories
679subdirectory
3cfe0f67
MBT
680subprocesses
681subr
65a32477
MBT
682subshell
683subversions
684suid
685sunmath
686sunos
687sunworks
688superseed
689symlink
690symlinking
691symlinks
692sys
693syscall
694syscalls
695sysctl
696syslib
697syslog
698syspath
699systemid
700systype
701sysv
702targetdir
703targetfrom
704targethost
705targetmkdir
706targetrun
707targetto
708targetuser
709tcp
710telldir
711thatlib
712thislib
713timegm
714timestamp
3cfe0f67 715timestamps
65a32477 716timeval
3cfe0f67 717timevals
65a32477
MBT
718tm
719tmp
3cfe0f67
MBT
720tmpfile
721tmpnam
65a32477
MBT
722tromey
723tryh
724trylist
725tsort
3cfe0f67 726ttyname
65a32477
MBT
727tye
728typedef
729typedefs
730tzset
731ualarm
732ucb
733uid
734uids
735uint
736uio
737uis
738ulimit
739ulrich
740ultrix
741undef
742undefines
743undefining
744undetached
745unicos
746unistd
747unix
748unlink
749unordered
750unorderedl
751unsetenv
752unsplit
753uppercased
754usg
755ushort
756usleep
757usr
758ustat
759util
760utimes
761utsname
762uu
763uvs
764ux
765varargs
766variadic
767varval
768venix
769verdoolaege
3cfe0f67 770versa
65a32477
MBT
771versioned
772versioning
773vfork
774vfs
775voidsig
776voidused
777vos
778vpath
779vprintf
780vsnprintf
781vsprintf
782whoami
783wifexited
784wifxxx
785wildcard
786wildcards
787winfried
788workshop
3cfe0f67 789writeup
65a32477
MBT
790writev
791xenix
792xlc
3cfe0f67 793xrun
65a32477 794xs
3cfe0f67 795xscan
65a32477
MBT
796xvt
797yp
798ypmatch
799zsh