view doc/interpreter/doccheck/mk_undocumented_list @ 17483:bddb9688e41c

feather.m: Overhaul function for Matlab visual compatibility. * scripts/plot/feather.m: Reduce length of arrowhead size to 0.20 of arrow shaft. Change arrow head angle with shaft from 45 to 30 degrees. Use variable 'h' instead of 'retval' to match documentation. Redo input validation. Add %!error input validation tests.
author Rik <rik@octave.org>
date Tue, 24 Sep 2013 13:17:04 -0700
parents 2ced2f59f523
children
line wrap: on
line source

#!/usr/bin/perl -w

################################################################################
# Get a list from Octave of all visible functions
@octave_output = <<`_END_OCT_SCRIPT_`;
../../run-octave --norc --silent --no-history --eval '\
 funclist  = vertcat (__list_functions__ , __builtins__) \
 disp("#!-separator-!#") \
 where = cellfun (\@which, funclist, \"UniformOutput\", 0)'
_END_OCT_SCRIPT_

unless (@octave_output) { die "Unable to invoke 'run-octave'.  Exiting\n" ;}

################################################################################
# Winnow list of functions that require a DOCSTRING

$idx = 0;
while (($_ = $octave_output[$idx++]) !~ /^#!-separator-!#$/)
{
   push(@all_functions, $1) if (/] = (\w+)$/);
}
while ($_ = $octave_output[$idx++])
{
   push(@where, $1) if (/] = (\S*)$/);
}

# Remove functions based on directory location
# deprecated directory, doc/interpreter directory, test/ directory
FUNC: foreach $idx (0 .. $#where)
{
   next FUNC if ($where[$idx] =~ /deprecated/i);
   next FUNC if ($where[$idx] =~ /interpreter/i);
   next FUNC if ($where[$idx] =~ m#test/#i);

   push (@functions, $all_functions[$idx]);
}

# Remove internal functions from the list of features requiring a DOCSTRING
@functions = grep (! /^__/, @functions);

# Load list of function exceptions not requiring a DOCSTRING
# Exception data is stored at the bottom of this script
map { chomp, $exceptions{$_}=1; } <DATA>;

# Remove exception data from the list
@functions = grep (! $exceptions{$_}, @functions);

################################################################################
# Get a list of all documented functions
foreach $txi_file (glob("*.txi"))
{
   open(TXI_FILE, $txi_file) or die "Unable to open $txi_file for reading\n";
   while (<TXI_FILE>)
   {
      $docstrings{$1} = 1 if (/\@DOCSTRING\((\w+)\)/) ;
   }
}

################################################################################
# Find features which have not been documented in the txi files
@undocumented = grep (! $docstrings{$_}, @functions);

# Exit successfully if no undocumented functions
exit(0) if (! @undocumented);

$, = "\n";  # Set output record separator
print sort(@undocumented);
exit(1);

################################################################################
# Exception list of functions not requiring a DOCSTRING
################################################################################
__DATA__
angle
bessel
besselh
besseli
besselk
bessely
bug_report
chdir
comma
debug
dbnext
exit
F_DUPFD
F_GETFD
F_GETFL
fact
finite
fmod
F_SETFD
F_SETFL
gammaln
home
i
ifelse
inf
inverse
isbool
isfinite
j
J
lower
lstat
nan
octave_tmp_file_name
O_APPEND
O_ASYNC
O_CREAT
O_EXCL
O_NONBLOCK
O_RDONLY
O_RDWR
O_SYNC
O_TRUNC
O_WRONLY
paren
SEEK_CUR
SEEK_END
semicolon
setenv
toc
triu
unimplemented
upper
ylabel
ylim
zlabel
zlim