From 8c769fe7229a74e60b03db471c98b5e8955a0f5c Mon Sep 17 00:00:00 2001 From: Frank Duncan Date: Thu, 13 Aug 2015 07:14:15 -0500 Subject: [PATCH] Add documentation and docgen --- .gitmodules | 3 +++ .travis.yml | 2 +- README.md | 8 ++------ bin/buildtravisexec.sh | 5 ++++- bin/generatedocs.sh | 8 ++++++++ bin/travis.lisp | 7 +++++++ deps/tarpit/docgen_0.1.tar.gz | Bin 0 -> 6023 bytes src/main/package.lisp | 9 ++++++++- src/main/syntax-checker.lisp | 37 +++++++++++++++++++++++++++++++++- wiki | 1 + 10 files changed, 70 insertions(+), 10 deletions(-) create mode 100644 .gitmodules create mode 100755 bin/generatedocs.sh create mode 100644 deps/tarpit/docgen_0.1.tar.gz create mode 160000 wiki diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..e90c9cf --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "wiki"] + path = wiki + url = https://github.com/frankduncan/style-checker.wiki.git diff --git a/.travis.yml b/.travis.yml index e7fc066..368439f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ before_install: - - wget http://frank.kank.net/travissbcl/style-checker/ef9a5c7/$(git rev-parse HEAD)/travissbcl + - wget http://frank.kank.net/travissbcl/style-checker/79f4f3d/$(git rev-parse HEAD)/travissbcl - chmod +x travissbcl script: diff --git a/README.md b/README.md index 290c324..209be70 100644 --- a/README.md +++ b/README.md @@ -27,10 +27,6 @@ If you like, you can [download it](https://github.com/frankduncan/style-checker/ ## Usage -``` -(check-file file) +See the [wiki](https://github.com/frankduncan/style-checker/wiki). -(check-directory dir) - -(check-directory pretty-print-check-directory) -``` +Also, see bin/travis.lisp to see how it's used in this package. diff --git a/bin/buildtravisexec.sh b/bin/buildtravisexec.sh index 20480da..6229432 100755 --- a/bin/buildtravisexec.sh +++ b/bin/buildtravisexec.sh @@ -12,7 +12,9 @@ mkdir -p tmp/deps/ ( cd tmp/deps && tar zxf ../../deps/tarpit/cl-ppcre.tar.gz && - ln -s cl-ppcre-2.0.10/cl-ppcre.asd . + tar zxf ../../deps/tarpit/docgen_0.1.tar.gz && + ln -s cl-ppcre-2.0.10/cl-ppcre.asd . && + ln -s docgen_0.1/docgen.asd . ) @@ -20,6 +22,7 @@ SBCL_HOME="" tmp/sbcl/bin/sbcl --core tmp/sbcl/lib/sbcl/sbcl.core --no-sysinit - --eval "(require 'asdf)" \ --eval '(setf asdf:*central-registry* (list #p"tmp/deps/"))' \ --eval "(asdf:load-system :cl-ppcre)" \ + --eval "(asdf:load-system :docgen)" \ --eval "(asdf:clear-output-translations)" \ --eval '(sb-ext:save-lisp-and-die "travissbcl" :executable t)' \ diff --git a/bin/generatedocs.sh b/bin/generatedocs.sh new file mode 100755 index 0000000..25af9b8 --- /dev/null +++ b/bin/generatedocs.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +sbcl \ + --eval "(asdf:load-system :docgen)" \ + --eval "(asdf:load-system :style-checker)" \ + --eval "(format t \"----~%\")" \ + --eval "(format t \"~A\" (docgen:export-package :syntax-checker))" \ + --eval "(quit)" 2> /dev/null | sed -n '/^----$/,$p' | tail -n +2 > wiki/Home.md diff --git a/bin/travis.lisp b/bin/travis.lisp index 4892120..17e87e1 100644 --- a/bin/travis.lisp +++ b/bin/travis.lisp @@ -13,6 +13,13 @@ (when (not (syntax-checker:pretty-print-check-directory "src")) (format t "~c[1;31mFailed style check!~c[0m~%" #\Esc #\Esc) (sb-ext:exit :code 1)) +(format t "~c[1;32m- Style Passed!~c[0m~%" #\Esc #\Esc) + +(format t "~%~c[1;33mChecking Docs~c[0m~%" #\Esc #\Esc) +(when (not (docgen:pretty-print-validate-packages :docgen)) + (format t "~c[1;31mFailed doc check!~c[0m~%" #\Esc #\Esc) + (sb-ext:exit :code 1)) +(format t "~c[1;32m- Doc Check Passed!~c[0m~%" #\Esc #\Esc) (format t "~c[1;32mSuccess!~c[0m~%" #\Esc #\Esc) (sb-ext:exit :code 0) diff --git a/deps/tarpit/docgen_0.1.tar.gz b/deps/tarpit/docgen_0.1.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..bad2c6ef32ee0ac9c4bc9f22b9035bf225772b04 GIT binary patch literal 6023 zcmV;27kKC&iwFQ-iOf|11MNNibKAzT{+WNp4HU;9BdDT3u>Mw-uK}^%Ae_bkH}O8fxErE{ocL9H7mzcUi`AZH~h=BPj&6X zb@$F4{C9Zw&c6Mxx~>gx-Z{86+`oP2*1@&?;mzTlgKO;0C&S3PR&|qBj9r`Y>NMxw z?KZvtUwUPR|KfIUp4ZEdI|efN;P&kf{tx#L?r8oGhqpmahPQ9+53jNPkBdh5`hU*< zI4_cAIzCIMob8N+2=sfsIOCJN;K{fwvb@R5g1t`Xd6wdBGD-9Ks^YB3=PZsF^^}eB zA_p?U4gIQkn(->oC4txdevidC(rUqrhF-JiMa?so7Y(n9bUwdeld@t08MaKTre;ma z>U;_>S!%&$ysFA-FX~H_R|T8$CaEtLr%7|M~31 z_t{9_LhEqjx~W#<24(}T&3$KcKx&LXp|!rX@RgI{nhWvrYzok#zaM`8_`%`HQS$8Y z{&$Cuj@YyB9R(G!Xf64$ragh#k{U*338?&-nO^A!y)PSwItjJYr9H zU1LX}bd!QS6jNX*@NprCk)D>ThWbmSdc6ln$M>HFmNpDTg&^|Zh2Th}Yk-wzps*ap#^uR$m1leoqFwJox4dq43Gg^A*eOR@LqUXI z@M8tH00~8r|Gq4%2Bx%!c>Yj;gq8&t(#Mt{>SADao&!eEwc^+wAR&^h$rpT=kOkU| z0sSIvXcWYgfxT^TjyRDN2IGhvIW5@kw-XRu0imy61r$7f-Dff3rzL5ZMhY}W z)n>2zbRn7oTR;~()MzW{IRhO@6u%P5FNr@2KA^a&XF_$Tr|ebpW+EQIJRKRP~^ z_7ChR{2i<@lCu4X{bR;KVJiltDN139lrS&T8jXk{P^WQiS-=gr3wuboqtU8XMQuAn zw6cIlIYC>p*aLWv8mSlz&yA0%;{4h{{ zRiP~hVCQnm(Ec2{N%5Vm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e{08a^;HEb;3<9Jh;@4dY+tV>PwgbNhA3J!=mpM3rrW9lKR=#if$g( zu7v3i3gO1F8}yAMmtQhc=p{bF6gfsJi>Rc#l~lF%%Bo&njXi5?L${7KvYSea=CrgN zdfcTOPKS_xcl$e1=Jahj`M4z#PWv?k_P$1!w9fc=j$f+9`Lw`~7Vt4Vj}$#34~qRU zx?)$$CPvzw2zEIEu*)+Ky!cK%09ZjtK6C{8TXtt0t&hrzOUO2J+Q7FTX8rk>_5IiK zZ2Cz)|JwBZ@6Cfdx8(P~2X}8C;P=0`4sIW8zyJCiSMd8UI$+|{e#~StCwZofRVQ?l zB|PS4?TYs^iGJrPQ?Z<&FunTl0ei(+o#sFlY_+Z&K2AWMhv4Q|to0EPwz~q-wuPJr zz6wgm5I)Pz;{?*Avh596qRBfBiZxZLfpEFi%i27?VMP3t>ODtRV)^# zw8g|?kDcM7+|Vm)Pn?_mnjKsMthFIZ1Ev)7~5E_<={DqM{UYn3Fg7Jq`^7nbe4PHN7gp$bri@_JvvO{iw?Y-@72 z7(SE@kX&F6o#zW=^`YkU63XSq;begDtm z5gy_(8q=q{BXRr`yltI#w=?pNrrHU)|DDnLGy3|0^MIeEd0`F!7IN9^y{Nf**p&JN zrqDrxLicMt645^#)*KDnOR3$sk+lLUw8%qY>r#MiW{|PSZ>_}PNX$NIN_5<1=d*my zd-Jk9!%c9I7~+BxStvRL5&axYD8+*o7vuu#rCQ@Prxypm!|!5-4xo1Qp+Y;>d1X7T z^Uro#=aKCMj#}%)g-#p1Dk_~&=;V>lKczog%l>;W%l;E@K1Bw&!T#SGs`HbDNg^xoMg3kJkUiz{kzd-Z@(e zi^|pVC9{n~ukh0n+|oB3LjTzfeY$ubPdQWfs&AwI-xi!rl#*gz9(KhQbOC@nT z6T5DXl$0r~%EioP5}BHr-0TXg1!A? RESULTS + + RESULTS: RESULT* + +ARGUMENTS AND VALUES: + + DIR: A directory to recurse into and check files + 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. + + 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." (mapcar #'check-file (directory (format nil "~A/**/*.lisp" dir)))) (defun any-failures (checks) @@ -142,6 +159,24 @@ EXAMPLES: (+ (fifth failure) 2))) (defun pretty-print-check-directory (dir) + "PRETTY-PRINT-CHECK-DIRECTORY DIR => SUCCESS + +ARGUMENTS AND VALUES: + + DIR: A directory to recurse into and check files + 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. + + 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" (let ((checks (check-directory dir))) (format t "In ~A: Checked ~A files with ~A failures~%~%" diff --git a/wiki b/wiki new file mode 160000 index 0000000..3e6a2ca --- /dev/null +++ b/wiki @@ -0,0 +1 @@ +Subproject commit 3e6a2caa124f2537f8ff9ad2c53f4bbaa285cb63 -- 2.25.1