Add ability to specify first line copyright notices
[wolf] / docs / Reference.md
index 24fb20d27e5a0904c4eb59d5e4836cea72260d69..bc2c8f53a2947ff49b9537dafb95975dc3dded17 100644 (file)
@@ -14,26 +14,29 @@ This package walks over common lisp code to make sure it adheres to a set of syn
 
 #### Syntax:
 
-**check-directory** _dir_ => _results_
+**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**
 
 #### Syntax:
 
-**check-file** _file_ => _result_
+**check-file** _file_ _&key_ _copyright-notice_ => _result_
 
 ```result::= success-result | failure-result```  
 ```success-result::= (:success filename)```  
@@ -42,6 +45,7 @@ The results are then put together into a list which can be programatically evalu
 #### 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  
@@ -51,26 +55,32 @@ _col-no_---an integer, the column number on which the failure appeared
 
 _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**
 
 #### Syntax:
 
-**pretty-print-check-directory** _dir_ => _success_
+**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: