changeset 21385:89fa0694aa2e

Fix check-missing-semicolon QA target (bug #47277). * scripts/module.mk: Recode check-missing-semicolon target to exclude files with classdef or nested functions. * subsref.m, subsref.m, cplxpair.m, waitbar.m, cubehelix.m, imshow.m, edit.m, unpack.m, annotation.m, axis.m, legend.m, __contour__.m, __ezplot__.m, __plt__.m, __gnuplot_drawnow__.m, copyobj.m, linkprop.m, __add_default_menu__.m, __gnuplot_print__.m, __print_parse_opts__.m, struct2hdl.m, ellipke.m, gallery.m, strjoin.m: Add missing semicolons to statements.
author Rik <rik@octave.org>
date Thu, 25 Feb 2016 10:37:59 -0800
parents ad1dbbd23f1d
children 23e8130ed024
files scripts/audio/@audioplayer/subsref.m scripts/audio/@audiorecorder/subsref.m scripts/general/cplxpair.m scripts/gui/waitbar.m scripts/image/cubehelix.m scripts/image/imshow.m scripts/miscellaneous/edit.m scripts/miscellaneous/unpack.m scripts/module.mk scripts/plot/appearance/annotation.m scripts/plot/appearance/axis.m scripts/plot/appearance/legend.m scripts/plot/draw/private/__contour__.m scripts/plot/draw/private/__ezplot__.m scripts/plot/draw/private/__plt__.m scripts/plot/util/__gnuplot_drawnow__.m scripts/plot/util/copyobj.m scripts/plot/util/linkprop.m scripts/plot/util/private/__add_default_menu__.m scripts/plot/util/private/__gnuplot_print__.m scripts/plot/util/private/__print_parse_opts__.m scripts/plot/util/struct2hdl.m scripts/specfun/ellipke.m scripts/special-matrix/gallery.m scripts/strings/strjoin.m
diffstat 25 files changed, 46 insertions(+), 43 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/audio/@audioplayer/subsref.m	Tue Mar 01 09:53:59 2016 -0800
+++ b/scripts/audio/@audioplayer/subsref.m	Thu Feb 25 10:37:59 2016 -0800
@@ -36,7 +36,7 @@
     field = idx.subs;
     value = get (player, field);
   else
-    error ("@audioplayer/subsref: invalid subscript type")
+    error ("@audioplayer/subsref: invalid subscript type");
   endif
 
 endfunction
--- a/scripts/audio/@audiorecorder/subsref.m	Tue Mar 01 09:53:59 2016 -0800
+++ b/scripts/audio/@audiorecorder/subsref.m	Thu Feb 25 10:37:59 2016 -0800
@@ -37,7 +37,7 @@
     field = idx.subs;
     value = get (recorder, field);
   else
-    error ("@audiorecorder/subsref: invalid subscript type")
+    error ("@audiorecorder/subsref: invalid subscript type");
   endif
 
 endfunction
--- a/scripts/general/cplxpair.m	Tue Mar 01 09:53:59 2016 -0800
+++ b/scripts/general/cplxpair.m	Thu Feb 25 10:37:59 2016 -0800
@@ -68,7 +68,7 @@
   if (nargin < 2 || isempty (tol))
     tol = 100;
   elseif (! isscalar (tol) || tol < 0)
-    error ("cplxpair: TOL must be a positive scalar number")
+    error ("cplxpair: TOL must be a positive scalar number");
   endif
 
   nd = ndims (z);
--- a/scripts/gui/waitbar.m	Tue Mar 01 09:53:59 2016 -0800
+++ b/scripts/gui/waitbar.m	Thu Feb 25 10:37:59 2016 -0800
@@ -184,7 +184,7 @@
                         "position", [fpos(3)-100 10 60 25],...
                         "callback", cb, "parent", hf);
     else
-      set (hbtn, "callback", cb)
+      set (hbtn, "callback", cb);
     endif
   elseif (! isempty (hbtn))
     delete (hbtn);
--- a/scripts/image/cubehelix.m	Tue Mar 01 09:53:59 2016 -0800
+++ b/scripts/image/cubehelix.m	Thu Feb 25 10:37:59 2016 -0800
@@ -50,7 +50,7 @@
                           rots = -1.5, hue = 1, gamma = 1)
 
   if (nargin > 5)
-    print_usage ()
+    print_usage ();
   elseif (! isscalar (n))
     error ("cubehelix: N must be a scalar");
   endif
--- a/scripts/image/imshow.m	Tue Mar 01 09:53:59 2016 -0800
+++ b/scripts/image/imshow.m	Thu Feb 25 10:37:59 2016 -0800
@@ -150,13 +150,13 @@
         case "xdata"
           xdata = varargin{narg++};
           if (! isvector (xdata))
-            error ("imshow: xdata must be a vector")
+            error ("imshow: xdata must be a vector");
           endif
           xdata = [xdata(1) xdata(end)];
         case "ydata"
           ydata = varargin{narg++};
           if (! isvector (ydata))
-            error ("imshow: ydata must be a vector")
+            error ("imshow: ydata must be a vector");
           endif
           ydata = [ydata(1) ydata(end)];
         otherwise
--- a/scripts/miscellaneous/edit.m	Tue Mar 01 09:53:59 2016 -0800
+++ b/scripts/miscellaneous/edit.m	Thu Feb 25 10:37:59 2016 -0800
@@ -163,7 +163,7 @@
     switch (toupper (statevar))
       case "EDITOR"
         error ("Octave:deprecated-function",
-               "The EDITOR option of edit has been removed.  Use EDITOR() directly.")
+               "The EDITOR option of edit has been removed.  Use EDITOR() directly.");
       case "HOME"
         if (! isempty (stateval) && stateval(1) == "~")
           stateval = [ get_home_directory, stateval(2:end) ];
--- a/scripts/miscellaneous/unpack.m	Tue Mar 01 09:53:59 2016 -0800
+++ b/scripts/miscellaneous/unpack.m	Thu Feb 25 10:37:59 2016 -0800
@@ -281,7 +281,7 @@
   ## Skip first line which is Archive header.
   files = char (output(2:end));
   ## Trim constant width prefix and return cell array.
-  files = cellstr (files(:,14:end))
+  files = cellstr (files(:,14:end));
 endfunction
 
 function output = __parse_tar__ (output)
--- a/scripts/module.mk	Tue Mar 01 09:53:59 2016 -0800
+++ b/scripts/module.mk	Thu Feb 25 10:37:59 2016 -0800
@@ -149,8 +149,11 @@
 
 check-missing-semicolon:
 	@echo "checking for missing semicolons in .m files..."
-	( echo "warning on Octave:missing-semicolon;"; \
-	  for m in $(addprefix $(srcdir), $(FCN_FILES)) $(GEN_FCN_FILES); do \
+	@( echo "warning on Octave:missing-semicolon;"; \
+	  for m in $(addprefix $(srcdir)/, $(FCN_FILES)) $(GEN_FCN_FILES); do \
+	    ! $(GREP) -q -E '^classdef' $$m || continue; \
+	    ! $(GREP) -q -E '^  *\<function\>' $$m || continue; \
+	    ! (echo $$m | $(GREP) -q __splinefit__.m) || continue; \
 	    echo "source ('$$m');"; \
 	  done ) | $(SHELL) run-octave --norc --silent --no-history
 .PHONY: check-missing-semicolon
--- a/scripts/plot/appearance/annotation.m	Tue Mar 01 09:53:59 2016 -0800
+++ b/scripts/plot/appearance/annotation.m	Thu Feb 25 10:37:59 2016 -0800
@@ -647,7 +647,7 @@
   cstr = inputdlg (prompt, prop, 1, def);
 
   if (! isempty (cstr))
-    set (hpar, prop, cstr)
+    set (hpar, prop, cstr);
   endif
 endfunction
 
@@ -826,7 +826,7 @@
     htmp(ii) = uimenu (h, "label", label, "callback", fcn);
   endfor
   handle_check (hpar, {}, htmp, pname, is_numeric);
-  addlistener (hpar, pname, {@handle_check, htmp, pname, is_numeric})
+  addlistener (hpar, pname, {@handle_check, htmp, pname, is_numeric});
 endfunction
 
 function handle_check (h, dummy, hmenus, prop, is_numeric)
--- a/scripts/plot/appearance/axis.m	Tue Mar 01 09:53:59 2016 -0800
+++ b/scripts/plot/appearance/axis.m	Thu Feb 25 10:37:59 2016 -0800
@@ -383,7 +383,7 @@
   elseif (diff (ylim == 0))
     ylim .*= (1 + eps () * [-1, 1]);
   endif
-  set (ca, "xlim", xlim, "ylim", ylim)
+  set (ca, "xlim", xlim, "ylim", ylim);
   nd = __calc_dimensions__ (ca);
   is3dview = (get (ca, "view")(2) != 90);
   if (nd > 2 && is3dview)
--- a/scripts/plot/appearance/legend.m	Tue Mar 01 09:53:59 2016 -0800
+++ b/scripts/plot/appearance/legend.m	Thu Feb 25 10:37:59 2016 -0800
@@ -980,7 +980,7 @@
                 ## This violates strict Matlab compatibility, but reliably
                 ## renders an esthetic result.
                 set (ca(i), "position",  unmodified_axes_position);
-                set (ca(i), "activepositionproperty", "outerposition")
+                set (ca(i), "activepositionproperty", "outerposition");
               else
                 ## numel (ca) > 1 for axes overlays (like plotyy)
                 set (ca(i), "position", new_pos);
--- a/scripts/plot/draw/private/__contour__.m	Tue Mar 01 09:53:59 2016 -0800
+++ b/scripts/plot/draw/private/__contour__.m	Thu Feb 25 10:37:59 2016 -0800
@@ -417,9 +417,9 @@
 
     switch (prop)
       case "levellist"
-        set (h, "levellistmode", "manual")
+        set (h, "levellistmode", "manual");
       case "levelstep"
-        set (h, "levelstepmode", "manual")
+        set (h, "levelstepmode", "manual");
       case "fill"
         ## Switching from filled ('k' linespec) to unfilled, reset linecolor
         if (strcmp (get (h, "fill"), "off"))
@@ -503,9 +503,9 @@
 
     switch (prop)
       case "textlist"
-        set (h, "textlistmode", "manual")
+        set (h, "textlistmode", "manual");
       case "textstep"
-        set (h, "textstepmode", "manual")
+        set (h, "textstepmode", "manual");
     endswitch
 
     if (strcmp (get (h, "textlistmode"), "manual"))
--- a/scripts/plot/draw/private/__ezplot__.m	Tue Mar 01 09:53:59 2016 -0800
+++ b/scripts/plot/draw/private/__ezplot__.m	Thu Feb 25 10:37:59 2016 -0800
@@ -520,10 +520,10 @@
 
     ## Handle nasty case of all NaNs
     if (isempty (rmin))
-      rmin = 1, rmax = rows (Z);
+      rmin = 1; rmax = rows (Z);
     endif
     if (isempty (cmin))
-      cmin = 1, cmax = columns (Z);
+      cmin = 1; cmax = columns (Z);
     endif
 
     if (   ! any (isnan (Z([rmin, rmax],:)(:)))
--- a/scripts/plot/draw/private/__plt__.m	Tue Mar 01 09:53:59 2016 -0800
+++ b/scripts/plot/draw/private/__plt__.m	Thu Feb 25 10:37:59 2016 -0800
@@ -78,12 +78,12 @@
         next_arg = squeeze (next_arg);
         if (! any (strcmp (caller, warned_callers)) && ndims (next_arg) < 3)
           warning (["%s: N-d inputs have been squeezed to less than " ...
-                    "three dimensions"], caller)
+                    "three dimensions"], caller);
           warned_callers(end+1) = caller;
         endif
       endif
       if (isnumeric (next_arg) && ndims (next_arg) > 2)
-        error ("%s: plot arrays must have less than 2 dimensions", caller)
+        error ("%s: plot arrays must have less than 2 dimensions", caller);
       endif
 
       nargs -= 1;
--- a/scripts/plot/util/__gnuplot_drawnow__.m	Tue Mar 01 09:53:59 2016 -0800
+++ b/scripts/plot/util/__gnuplot_drawnow__.m	Thu Feb 25 10:37:59 2016 -0800
@@ -340,7 +340,7 @@
       endif
     endif
     if (__gnuplot_has_feature__ ("has_termoption_dashed"))
-      fprintf (plot_stream, "set termoption dashed\n")
+      fprintf (plot_stream, "set termoption dashed\n");
     endif
   else
     ## gnuplot will pick up the GNUTERM environment variable itself
--- a/scripts/plot/util/copyobj.m	Tue Mar 01 09:53:59 2016 -0800
+++ b/scripts/plot/util/copyobj.m	Thu Feb 25 10:37:59 2016 -0800
@@ -66,7 +66,7 @@
   ## reset current figure (and eventually axes) to original
   set (0, "currentfigure", cf);
   if (ancestor (hnew, "figure") == cf && ! isempty (ca))
-    set (cf, "currentaxes", ca)
+    set (cf, "currentaxes", ca);
   endif
 
 endfunction
--- a/scripts/plot/util/linkprop.m	Tue Mar 01 09:53:59 2016 -0800
+++ b/scripts/plot/util/linkprop.m	Thu Feb 25 10:37:59 2016 -0800
@@ -109,7 +109,7 @@
   for i = 1 : numel (hlist)
     if (ishandle (hlist(i)))
       for j = 1 : numel (prop)
-        dellistener (hlist(i), prop{j}),
+        dellistener (hlist(i), prop{j});
       endfor
     endif
   endfor
--- a/scripts/plot/util/private/__add_default_menu__.m	Tue Mar 01 09:53:59 2016 -0800
+++ b/scripts/plot/util/private/__add_default_menu__.m	Thu Feb 25 10:37:59 2016 -0800
@@ -82,7 +82,7 @@
                                    [pwd, filesep, "untitled.pdf"]);
   if (filename != 0)
     fname = [filedir filesep() filename];
-    set (gcbf, "filename", fname)
+    set (gcbf, "filename", fname);
     saveas (caller, fname);
   endif
 endfunction
@@ -110,7 +110,7 @@
 
 function autoscale_cb (h, e)
   hax = __get_axes__ (h);
-  arrayfun (@(h) axis (h, "auto"), hax)
+  arrayfun (@(h) axis (h, "auto"), hax);
   drawnow ();
 endfunction
 
@@ -119,16 +119,16 @@
   id = get (h, "tag");
   switch (id)
     case "pan_on"
-      pan (fig, "on")
+      pan (fig, "on");
     case "pan_xon"
-      pan (fig, "xon")
+      pan (fig, "xon");
     case "pan_yon"
-      pan (fig, "yon")
+      pan (fig, "yon");
     case "rotate3d"
-      rotate3d (fig, "on")
+      rotate3d (fig, "on");
     case "no_pan_rotate"
-      pan (fig, "off")
-      rotate3d (fig, "off")
+      pan (fig, "off");
+      rotate3d (fig, "off");
     case "zoom_on"
       arrayfun (@(h) set (h, "mousewheelzoom", 0.05), hax);
     case "zoom_off"
--- a/scripts/plot/util/private/__gnuplot_print__.m	Tue Mar 01 09:53:59 2016 -0800
+++ b/scripts/plot/util/private/__gnuplot_print__.m	Thu Feb 25 10:37:59 2016 -0800
@@ -222,7 +222,7 @@
     drawnow (term, file, mono, opts.debug_file);
   endif
   if (opts.debug)
-    fprintf ("Expanded gnuplot terminal = '%s'\n", term)
+    fprintf ("Expanded gnuplot terminal = '%s'\n", term);
   endif
 endfunction
 
--- a/scripts/plot/util/private/__print_parse_opts__.m	Tue Mar 01 09:53:59 2016 -0800
+++ b/scripts/plot/util/private/__print_parse_opts__.m	Thu Feb 25 10:37:59 2016 -0800
@@ -329,14 +329,14 @@
       ## Pipe the ghostscript output
       arg_st.name = "-";
     else
-      error ("print: a filename may not specified when spooling to a printer")
+      error ("print: a filename may not specified when spooling to a printer");
     endif
     if (! any (strcmp (arg_st.devopt, gs_device_list)))
       ## Only supported ghostscript devices
-      error ("print: format must be a valid Ghostscript format for spooling to a printer")
+      error ("print: format must be a valid Ghostscript format for spooling to a printer");
     endif
   elseif (isempty (arg_st.name))
-    error ("print: an output filename must be specified")
+    error ("print: an output filename must be specified");
   endif
 
   if (isempty (arg_st.canvas_size))
--- a/scripts/plot/util/struct2hdl.m	Tue Mar 01 09:53:59 2016 -0800
+++ b/scripts/plot/util/struct2hdl.m	Thu Feb 25 10:37:59 2016 -0800
@@ -153,7 +153,7 @@
   elseif (strcmp (s.type, "hggroup"))
     [h, s, p] = createhg (s, p, par, hilev);
   else
-    error ("struct2hdl: %s objects are not implemented yet", s.type)
+    error ("struct2hdl: %s objects are not implemented yet", s.type);
   endif
 
   ## children
--- a/scripts/specfun/ellipke.m	Tue Mar 01 09:53:59 2016 -0800
+++ b/scripts/specfun/ellipke.m	Thu Feb 25 10:37:59 2016 -0800
@@ -103,7 +103,7 @@
   if (isempty (tol))
     tol = eps (class (m));
   elseif (! (isreal (tol) && isscalar (tol) && tol > 0))
-    error ("ellipke: TOL must be a real scalar > 0")
+    error ("ellipke: TOL must be a real scalar > 0");
   endif
 
   k = e = zeros (sz);
--- a/scripts/special-matrix/gallery.m	Tue Mar 01 09:53:59 2016 -0800
+++ b/scripts/special-matrix/gallery.m	Thu Feb 25 10:37:59 2016 -0800
@@ -1600,9 +1600,9 @@
   if (nargin < 1 || nargin > 2)
     error ("gallery: 1 to 2 arguments are required for lauchli matrix.");
   elseif (! isnumeric (n) || ! isscalar (n) || fix (n) != n)
-    error ("gallery: N must be an integer for lauchli matrix.")
+    error ("gallery: N must be an integer for lauchli matrix.");
   elseif (! isscalar (rho))
-    error ("gallery: RHO must be a scalar for lauchli matrix.")
+    error ("gallery: RHO must be a scalar for lauchli matrix.");
   endif
 
   A = (1:n)'*ones (1,n);
--- a/scripts/strings/strjoin.m	Tue Mar 01 09:53:59 2016 -0800
+++ b/scripts/strings/strjoin.m	Thu Feb 25 10:37:59 2016 -0800
@@ -72,7 +72,7 @@
     delimiter(end) = {""};
   elseif (num > 0 && numel (delimiter) != num - 1)
     error ("strjoin:cellstring_delimiter_mismatch",
-      "strjoin: the number of delimiters does not match the number of strings")
+      "strjoin: the number of delimiters does not match the number of strings");
   else
     delimiter(end+1) = {""};
   endif