( x . y )
email: frank@consxy.com | resume (pdf)

Package WOLF (link)

Enforces arbitrary set of style guidelines.

This package walks over common lisp code to make sure it adheres to a set of syntactic guidelines designed to ensure a semblance of uniformity. No current one was found that could be configured to work the way this one does, so instead of writing a configurable tool, another unconfigurable one was born.

Contents (link)

  • function check-directory - check-directory grabs all .lisp files in the tree under dir, and loads checks them all.
  • function check-file - check-file runs all the checks against a file and returns as soon as the first style error is found.
  • function pretty-print-check-directory - pretty-print-check-directory checks dir for any errors, dumping them to output and returning a single flag.

Function CHECK-DIRECTORY (link)

Syntax:

check-directory dir &key copyright-notice => results

results::= result*

Arguments and Values:

dir---A directory to recurse into and check files copyright-notice---A regex string result---A result as returned by check-file

Description:

check-directory grabs all .lisp files in the tree under dir, and loads checks them all.

If copyright-notice is included, then the first line must match the regular expression passed.

The results are then put together into a list which can be programatically evaluated. As opposed to pretty-print-check-directory, this function doesn't clutter up your standard out.

Function CHECK-FILE (link)

Syntax:

check-file file &key copyright-notice => result

result::= success-result | failure-result success-result::= (:success filename) failure-result::= (:success filename msg line-no col-no)

Arguments and Values:

file---a pathname copyright-notice---A regex string filename---the file this check was run on msg---a string containing the failure message line-no---an integer, the line number on which the failure appeared col-no---an integer, the column number on which the failure appeared

Description:

check-file runs all the checks against a file and returns as soon as the first style error is found.

If copyright-notice is included, then the first line must match the regular expression passed.

Examples:

(check-file #P"path/to/file.lisp") => (:success "path/to/file.lisp") (check-file #P"path/to/error.lisp") => (:failure "path/to/error.lisp" "File cannot end with empty line" 20 0) (check-file #P"path/to/error.lisp" :copyright-notice "; Copyright .* AGPL") => (:failure ...)

Function PRETTY-PRINT-CHECK-DIRECTORY (link)

Syntax:

pretty-print-check-directory dir &key copyright-notice => success

Arguments and Values:

dir---A directory to recurse into and check files copyright-notice---A regex string success---T if there were no failures

Description:

pretty-print-check-directory checks dir for any errors, dumping them to output and returning a single flag.

If copyright-notice is included, then the first line must match the regular expression passed.

Unlike check-directory, pretty-print-check-directory is built for continuous integration, dumping errors to standard out and returning a singular result.

Examples:

(pretty-print-check-directory "src") => nil