ccanlint.1 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455
  1. '\" t
  2. .\" Title: ccanlint
  3. .\" Author: [see the "AUTHOR" section]
  4. .\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
  5. .\" Date: 12/05/2011
  6. .\" Manual: \ \&
  7. .\" Source: \ \&
  8. .\" Language: English
  9. .\"
  10. .TH "CCANLINT" "1" "12/05/2011" "\ \&" "\ \&"
  11. .\" -----------------------------------------------------------------
  12. .\" * Define some portability stuff
  13. .\" -----------------------------------------------------------------
  14. .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  15. .\" http://bugs.debian.org/507673
  16. .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
  17. .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  18. .ie \n(.g .ds Aq \(aq
  19. .el .ds Aq '
  20. .\" -----------------------------------------------------------------
  21. .\" * set default formatting
  22. .\" -----------------------------------------------------------------
  23. .\" disable hyphenation
  24. .nh
  25. .\" disable justification (adjust text to left margin only)
  26. .ad l
  27. .\" -----------------------------------------------------------------
  28. .\" * MAIN CONTENT STARTS HERE *
  29. .\" -----------------------------------------------------------------
  30. .SH "NAME"
  31. ccanlint \- Make CCAN code modules, and the brightness up\&.
  32. .SH "SYNOPSIS"
  33. .sp
  34. \fBccanlint\fR [\fIOPTIONS\fR] [\fIDIRECTORY\fR\&...]
  35. .SH "DESCRIPTION"
  36. .sp
  37. No encoder? No need to \fBccanlint\fR\&. You programmer? Excited to \fBccanlint\fR!
  38. .sp
  39. CCAN module is small code of the song\&. \fBccanlint\fR full CCAN testing tool\&. Each test spray bit of wisdom\&. Also score\&. Good score good\&. Bad bad score\&.
  40. .sp
  41. \fBccanlint\fR expect the source code in this directory, or command line can be more than one\&. Exit 0 happy if all modules all tests happy\&.
  42. .SH "OPTIONS"
  43. .PP
  44. \fB\-v, \-\-verbose\fR
  45. .RS 4
  46. Make
  47. \fBccanlint\fR
  48. talkative\&. "\-vv" doing very talkative\&. "\-vvvv" make stupid talker\&.
  49. .RE
  50. .PP
  51. \fB\-n, \-\-safe\-mode\fR
  52. .RS 4
  53. Do not compile anything\&. Could it be safer for the bad code, but
  54. \fBccanlint\fR
  55. sad useless\&.
  56. .RE
  57. .PP
  58. \fB\-l, \-\-list\-tests\fR
  59. .RS 4
  60. Tests show
  61. \fBccanlint\fR
  62. can do\&. Then die happy\&.
  63. .RE
  64. .PP
  65. \fB\-\-test\-dep\-graph\fR
  66. .RS 4
  67. Chart of all parties
  68. \fBccanlint\fR
  69. tests
  70. \fIdot(1)\fR
  71. Graphviz, then die happy\&.
  72. .RE
  73. .PP
  74. \fB\-k, \-\-keep\fR
  75. .RS 4
  76. \fBccanlint\fR
  77. normally make mess temporary directory, but now it later in forensic\&.
  78. .RE
  79. .PP
  80. \fB\-s, \-\-summary\fR
  81. .RS 4
  82. \fBccanlint\fR
  83. just realized there is no message unless you die horrible\&.
  84. .RE
  85. .PP
  86. \fB\-x, \-\-exclude\fR=\fITESTNAME\fR
  87. .RS 4
  88. No test run\&. Can the use of time many, many do
  89. \fBccanlint\fR
  90. very, very quickly\&. Often hatred
  91. \fItests_run_valgrind\fR
  92. that the test slowed\&.
  93. .RE
  94. .PP
  95. \fB\-\-timeout\fR=\fIMILLISECONDS\fR
  96. .RS 4
  97. Stop the test and forget it if you take too long\&. Generally, the same works as
  98. \fI\-x tests_run_valgrind\fR\&.
  99. .RE
  100. .PP
  101. \fB\-t, \-\-target\fR=\fITESTNAME\fR
  102. .RS 4
  103. Do not run all tests\&. Run this test, and the proof you need\&. Used many times for many tests\&.
  104. .RE
  105. .PP
  106. \fB\-\-compiler\fR=\fICOMPILER\fR
  107. .RS 4
  108. \fBccanlint\fR
  109. read config\&.h about finding
  110. \fICCAN_COMPILER\fR\&. Otherwise use the default when it was built\&. The change, to use this compiler\&.
  111. .RE
  112. .PP
  113. \fB\-\-cflags\fR=\fICFLAGS\fR
  114. .RS 4
  115. Set compiler options to compile\&. Be sure to protect spaces shell hunger\&.
  116. .RE
  117. .SH "TESTS"
  118. .sp
  119. \fBccanlint\fR many tests\&. Each test will score soon\&. Not total score for each test unless stupid module or no life\&. Worry if little or low score score after hacking\&.
  120. .sp
  121. If test break, but not repair, or maybe the dumb test, put the magic lines \fI_info\fR file like this\&. \fBccanlint\fR to score from 0 of 1 for test, but happy:
  122. .sp
  123. .if n \{\
  124. .RS 4
  125. .\}
  126. .nf
  127. * Ccanlint:
  128. * // Test module foolish for me great!
  129. * info_documentation_exists FAIL
  130. * // Error for the file may be only
  131. * tests_pass_valgrind_noleaks test/run\-mytest\&.c:FAIL
  132. .fi
  133. .if n \{\
  134. .RE
  135. .\}
  136. .PP
  137. \fBinfo_exists\fR
  138. .RS 4
  139. CCAN module must have
  140. \fI_info\fR
  141. file describing\&. No this score is 0\&. However,
  142. \fBccanlint\fR
  143. question may help to write one\&.
  144. .RE
  145. .PP
  146. \fBdepends_exist\fR
  147. .RS 4
  148. \fI_info\fR
  149. file CCAN other module without saying, must find\&. It is not score 0\&.
  150. .RE
  151. .PP
  152. \fBobjects_build\fR
  153. .RS 4
  154. All build purposes
  155. \fI\&.c\fR
  156. in the top dir\&. Not score 0\&.
  157. .RE
  158. .PP
  159. \fBmodule_builds\fR
  160. .RS 4
  161. Link to all objects in an object module\&. Not score 0\&.
  162. .RE
  163. .PP
  164. \fBdepends_accurate\fR
  165. .RS 4
  166. Include other CCAN modules, we must say we need to
  167. \fI_info\fR
  168. depends\&. Only one thing allows different, you can use
  169. \fIccan/tap\fR
  170. for testing anyway\&.
  171. .RE
  172. .PP
  173. \fBdepends_build\fR
  174. .RS 4
  175. We try to generate the CCAN module you need\&.
  176. .RE
  177. .PP
  178. \fBexamples_exist\fR
  179. .RS 4
  180. Rather hope that the comments in the header, and
  181. \fI_info\fR\&. An example of the section in each, please! Maybe more,
  182. \fBccanlint\fR
  183. very happy morning\&.
  184. .RE
  185. .PP
  186. \fBexamples_relevant\fR
  187. .RS 4
  188. Example, do not cut and paste away! You say the name of the thing in the example or
  189. \fBccanlint\fR
  190. unhappy\&.
  191. .RE
  192. .PP
  193. \fBhash_if\fR
  194. .RS 4
  195. Module wants
  196. \fBccanlint\fR
  197. \fIconfig\&.h\fR
  198. "#define HAVE_FEATURE" for all feature\&. Function test "#if HAVE_FEATURE" no "#ifdef HAVE_FEATURE" because user might not know about the role at all\&. Intelligent GCC flag
  199. \fI\-Wundef\fR
  200. say HAVE_FEATURE not 0, not 1! but only if the use of
  201. \fI#if\fR\&.
  202. .RE
  203. .PP
  204. \fBinfo_documentation_exists\fR
  205. .RS 4
  206. \fI_info\fR
  207. file format is pretty comments\&. Copying someone\&. It is not difficult write documentation!
  208. .RE
  209. .PP
  210. \fBinfo_summary_single_line\fR
  211. .RS 4
  212. Comments from a top line often describe the function or macro\&.
  213. \fI_info\fR
  214. comment top line describes complete module\&. Characteristics make you scream!
  215. .RE
  216. .PP
  217. \fBlicense_exists\fR
  218. .RS 4
  219. The lawyers eat me\&.
  220. \fI_info\fR
  221. have
  222. \fILicense:\fR
  223. in the observation and LICENSE file there\&. In general, is the link:
  224. \fBccanlint\fR
  225. offer create a link, if they know
  226. \fILicense:\fR\&.
  227. .RE
  228. .PP
  229. \fBlicense_comment\fR
  230. .RS 4
  231. Attorney everywhere\&. Please put a comment saying something like "GPL Version 4\&. Read LICENSE\&." in all source files in the directory\&.
  232. .RE
  233. .PP
  234. \fBlicense_file_compat\fR
  235. .RS 4
  236. Do not lie about the license!
  237. \fBccanlint\fR
  238. search files, see the license of another, angry here\&.
  239. .RE
  240. .PP
  241. \fBlicense_depends_compat\fR
  242. .RS 4
  243. Hostile to BSD license module, but requires another module of the GPL\&. Perhaps poor encoder think all BSD code, unloading and damage attorney stick! Ay ay!
  244. .RE
  245. .PP
  246. \fBmain_header_exists\fR
  247. .RS 4
  248. \fBccanlint\fR
  249. know the module name directory name\&. Expect the same name for header\&.
  250. .RE
  251. .PP
  252. \fBheaders_idempotent\fR
  253. .RS 4
  254. Good header
  255. \fI#include\fR
  256. many time happy\&. Rap header around easy\&.
  257. \fBccanlint\fR
  258. say it can fix too\&. Always work\&.
  259. .RE
  260. .PP
  261. \fBmain_header_compiles\fR
  262. .RS 4
  263. Simple program
  264. \fI#include\fR
  265. main header compile\&.
  266. .RE
  267. .PP
  268. \fBavoids_cpp_reserved\fR
  269. .RS 4
  270. C++ programmer to include code\&. Not like them anyway, maybe, but wrong end your program, do mourn\&. Only main header compile C++ and if trying to compile C\e++ module stupid to pieces\&.
  271. .RE
  272. .PP
  273. \fBno_trailing_whitespace\fR
  274. .RS 4
  275. Linux kernel programmers more, solve the problem for the space of the final ban the line\&. Now all lots of hackers working to fix it\&. Want to famous and Linux? Leave extra space too!
  276. .RE
  277. .PP
  278. \fBexamples_compile\fR
  279. .RS 4
  280. \fBccanlint\fR
  281. very smart! Take
  282. \fIExample:\fR
  283. from a comment in the header and
  284. \fI_info\fR\&. First try to compile anything\&. If not, add many headers and maybe put inside the function\&. It does not work, adds the latest example\&. If the last example has
  285. \fI\&...\fR
  286. try that maybe\&. Sometimes too complicated!
  287. \fI\-vv\fR
  288. or
  289. \fI\-\-keep\fR
  290. to see why it broke\&. Or maybe bad example
  291. \fBccanlint\fR
  292. says wow!
  293. .RE
  294. .PP
  295. \fBexamples_run\fR
  296. .RS 4
  297. If the example program that comments like
  298. \fI// given foo outputs bar\fR
  299. \fBccanlint\fR
  300. will run the food program
  301. \fIfoo\fR
  302. in the command line and standard input\&. Happy if
  303. \fIbar\fR
  304. are out\&. You can do \*(Aq or " about the production or determined\&. You can also
  305. \fIoutput contains\fR
  306. more relaxed controls\&.
  307. .RE
  308. .PP
  309. \fBmodule_links\fR
  310. .RS 4
  311. CCAN link to the program module simply no error\&.
  312. .RE
  313. .PP
  314. \fBobjects_build_with_stringchecks\fR
  315. .RS 4
  316. Module
  317. \fIccan/str\fR
  318. is super difficult to detect errors debugging chain\&.
  319. \fBccanlint\fR
  320. use with the module and see break!
  321. .RE
  322. .PP
  323. \fBtests_exist\fR
  324. .RS 4
  325. You have CCAN module directory called
  326. \fItest\fR\&. You have proof here\&. If there is no proof,
  327. \fBccanlint\fR
  328. still offer make proof for you\&.
  329. .RE
  330. .PP
  331. \fBtests_compile\fR
  332. .RS 4
  333. In
  334. \fItest\fR
  335. which has four such tests, start with different name\&.
  336. \fIrun\fR
  337. compile the test files, but no link to the module, you
  338. \fI#include\fR
  339. to get the bits of the module\&.
  340. \fIapi\fR
  341. test compile and link with the module\&.
  342. \fIcompile\-ok\fR
  343. as
  344. \fIrun\fR
  345. but only build\&.
  346. \fIcompile\-fail\fR
  347. compile, but when
  348. \fIFAIL\fR
  349. set has to break or alert\&. This good for module supposed to warn\&.
  350. .RE
  351. .PP
  352. \fBtest_helpers_compile\fR
  353. .RS 4
  354. Other files
  355. \fItest\fR? Compilation of links to all tests\&. Ask for help\&.
  356. .RE
  357. .PP
  358. \fBtests_pass\fR
  359. .RS 4
  360. \fIrun\fR
  361. and
  362. \fIapi\fR
  363. test happy departure\&. If not happy, offer debugger\&.
  364. .RE
  365. .PP
  366. \fBtests_pass_valgrind\fR
  367. .RS 4
  368. \fBvalgrind\fR
  369. the tool of all
  370. \fIrun\fR
  371. and
  372. \fIapi\fR
  373. slow test\&. However, we found many errors! If
  374. \fBvalgrind\fR
  375. test rest,
  376. \fI_info\fR
  377. have
  378. \fBccanlint\fR
  379. section, make "tests_pass_valgrind test/TESTNAME:FAIL"\&. If required valgrind additional option, "tests_pass_valgrind test/TESTNAME:\-\-option"\&.
  380. .RE
  381. .PP
  382. \fBtests_pass_valgrind_noleaks\fR
  383. .RS 4
  384. \fBvalgrind\fR
  385. complain if the memory leak test\&.
  386. \fI_info\fR
  387. can also be disabled\&.
  388. .RE
  389. .PP
  390. \fBtests_compile_coverage\fR
  391. .RS 4
  392. Compile
  393. \fIrun\fR,
  394. \fIapi\fR
  395. test coverage\&. Fun if not here!
  396. .RE
  397. .PP
  398. \fBtests_coverage\fR
  399. .RS 4
  400. Run tests again, find lines that never try! Half of the lines 1 point 3/4 getting 2 points\&. Limit of 5 points, but the extra point for all lines of evidence\&. Not win unless the module silly or use gimmick
  401. \fIccan/failtest\fR\&.
  402. .RE
  403. .PP
  404. \fBreduce_features\fR
  405. .RS 4
  406. Code use
  407. \fIHAVE_FEATURE\fR
  408. make special config\&.h turned off\&. Not stupid like HAVE_BIG_ENDIAN though!
  409. .RE
  410. .PP
  411. \fBdepends_build_without_features\fR
  412. .RS 4
  413. Make modules CCAN need\&. config\&.h but not more features\&.
  414. .RE
  415. .PP
  416. \fBobjects_build_without_features\fR
  417. .RS 4
  418. Make the module again, but not more features\&.
  419. .RE
  420. .PP
  421. \fBtests_helpers_compile_without_features\fR
  422. .RS 4
  423. Helpers do try again, but not more features\&.
  424. .RE
  425. .PP
  426. \fBtests_compile_without_features\fR
  427. .RS 4
  428. Collect the tests again, but not more features\&.
  429. .RE
  430. .sp
  431. \fBtests_pass_without_features\fR: Run tests again, but not more features\&.
  432. .SH "BUGS"
  433. .sp
  434. \fBccanlint\fR rapid change\&. The bad man, bad page\&.
  435. .SH "AUTHOR"
  436. .sp
  437. Rusty Russell wrote \fBccanlint\fR\&. Helping others, but most break Rusty\&.
  438. .SH "RESOURCES"
  439. .sp
  440. Main web site: http://ccodearchive\&.net/
  441. .sp
  442. Wiki: https://github\&.com/rustyrussell/ccan/wiki/
  443. .SH "COPYING"
  444. .sp
  445. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version\&.