+ (mapcar #'check-file (directory (format nil "~A/**/*.lisp" dir))))
+
+(defun any-failures (checks)
+ (find :failure checks :key #'car))
+
+(defun print-failure (failure)
+ (format nil
+ "Style error in ~A at ~A:~A: ~A~%- ~A~%~VT^"
+ (second failure)
+ (1+ (fourth failure))
+ (1+ (fifth failure))
+ (third failure)
+ (with-open-file (str (second failure)) (loop :repeat (fourth failure) :do (read-line str)) (read-line str))
+ (+ (fifth failure) 2)))
+
+(defun pretty-print-check-directory (dir)
+ (let
+ ((checks (check-directory dir)))
+ (format t "In ~A: Checked ~A files with ~A failures~%~%" dir (length checks) (length (remove :success checks :key #'car)))
+ (format t "~{~A~%~}" (mapcar #'print-failure (remove :success checks :key #'car)))
+ (sb-ext:exit :code (if (any-failures checks) 1 0))))