-
before-commitis a wrapper of folowing 3 script to do static check, unittest and generate Table of content section of doc. -
pyautorun static code check and reformat on python source code file.Usage:
# check all *.py in current dir, recursively. $ pyauto # check one file: $ pyauto a.py -
trun python built in unittest.tmust be run in a module dir such ashumannum.An optional argument can be used to specify what module/class/function to test:
# test all cd pykit; script/t.sh # test a module cd pykit; script/t.sh zkutil cd pykit; script/t.sh zkutil.test # test a file cd pykit; script/t.sh zkutil.test.test_zkutil # test a class cd pykit; script/t.sh zkutil.test.test_zkutil.TestZKUtil # test a function cd pykit; script/t.sh zkutil.test.test_zkutil.TestZKUtil.test_lock_data # absolute package path cd pykit; script/t.sh pykit.zkutil.test.test_zkutil.TestZKUtil.test_lock_data # relative path: following are the same: cd pykit; script/t.sh pykit.zkutil.test.test_zkutil cd pykit/zkutil; ../script/t.sh test.test_zkutil cd pykit/zkutil/test/; ../../script/t.sh test_zkutilOne can use
-vto telltto display verbose info during test:-
t -vlets python unittest run in verbose mode: to display each case function. -
t -vvort -v -venables displaying debug message bypykit.ututil.dd(). -
t -Cto skip dependency check. If you are sure about dependency is complete, use-Cto speed up test.
-
-
tocadd Table-of-Content to markdown files.Usage:
# build TOC for all *.md $ toc # build TOC for files: $ toc a.md b.md
Zhang Yanpo (张炎泼) drdr.xp@gmail.com
The MIT License (MIT)
Copyright (c) 2015 Zhang Yanpo (张炎泼) drdr.xp@gmail.com