Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

0.9.2.40:

	added scripts to impose whitespace canonicalization
	added scripts to check that sources haven't drifted away from
		canonical whitespacing (as when someone doesn't use
		emacs' INDENT-TABS-MODE=NIL...)
	(Note that the scripts include an annoying level of "echo"-ish
		commands which should probably be removed once things seem
		to be working OK for everyone.)
	(Something about huge touch-every-file "cvs commit" of
		canonicalized-whitespace versions of all sources is
		clashing with my flaky internet connection, so there may
		be some further delay in committing the result of running
		the scripts.)
  • Loading branch information...
commit 1af3faa2b79125b774c2182cab841ed7ee555bed 1 parent 5563d27
William Harold Newman authored
View
9 tools-for-build/canonicalize-whitespace
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+# (a script to be run in the root directory of the distribution)
+#
+# Convert tabs to spaces and delete trailing whitespace in files
+# which we can safely assume to be source files in appropriate languages.
+
+tools-for-build/whitespacely-canonical-filenames \
+ | xargs tools-for-build/canonicalize-whitespace-1
View
28 tools-for-build/canonicalize-whitespace-1
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+# in-place "canonicalize-whitespace" conversion for files in $*:
+# * Convert tabs to spaces.
+# * Delete trailing whitespace.
+# (on $*, in place, overwriting the old file)
+
+scratchfilename=/tmp/canonicalize-whitespace-1.$$.tmp
+
+echo '/in canonicalize-whitespace-1'
+echo '/$*'=$*
+echo '/$scratchfilename='$scratchfilename
+
+for f in $*; do
+
+ echo '/$f'=$f
+
+ # We reuse the "expand" GNU utility to remove tabs, but if it turns out
+ # not to be available everywhere (or someone has defined "expand" to
+ # mean something else on some other class of system!) we could probably
+ # hand-code a replacement in a few lines.
+ expand $f > $scratchfilename
+
+ sed 's/[ ]*$//' < $scratchfilename > $f
+
+done
+
+rm $scratchfilename
View
6 tools-for-build/check-canonical-whitespace
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+# Look for violations of whitespace canonicalization. On the first
+# one found, print the line (mostly to help humans) and exit with
+# nonzero (mostly to help scripts).
+
View
9 tools-for-build/grep-noncanonical-whitespace
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+# Look for violations of whitespace canonicalization, handling them as
+# greppish matches:
+# * Print human-readable description of each one.
+# * Exit with 0 if >=1 found, or exit with 0 if none found.
+
+tools-for-build/whitespacely-canonical-filenames | \
+ xargs egrep --with-filename ' | $'
View
19 tools-for-build/whitespacely-canonical-filenames
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+# (a script to be run in the root directory of the distribution,
+# probably as part of an enclosing do-something-with-whitespace script)
+#
+# Print to stdout the names of files whose whitespace we (SBCLers)
+# try to keep canonical.
+
+# glob patterns for source files in languages for which the
+# canonicalization is safe (not affecting meaning, at least given the
+# conservative syntax used in SBCL sources)
+source_extensions='.lisp .lisp-expr .c .h'
+# other candidates:
+# .sh
+# ?
+
+for source_extension in $source_extensions; do
+ find . -name '*'$source_extension -print
+done
View
2  version.lisp-expr
@@ -17,4 +17,4 @@
;;; checkins which aren't released. (And occasionally for internal
;;; versions, especially for internal versions off the main CVS
;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"0.9.2.39"
+"0.9.2.40"
Please sign in to comment.
Something went wrong with that request. Please try again.