ccanlint.1.txt 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  1. CCANLINT(1)
  2. ===========
  3. :doctype: manpage
  4. NAME
  5. ----
  6. ccanlint - Make CCAN code modules, and the brightness up.
  7. SYNOPSIS
  8. --------
  9. *ccanlint* ['OPTIONS'] ['DIRECTORY'...]
  10. DESCRIPTION
  11. -----------
  12. No encoder? No need to *ccanlint*. You programmer? Excited to *ccanlint*!
  13. CCAN module is small code of the song. *ccanlint* full CCAN testing
  14. tool. Each test spray bit of wisdom. Also score. Good score good.
  15. Bad score bad.
  16. *ccanlint* expect the source code in this directory, or command line can be
  17. more than one. Exit 0 happy if all modules all tests happy.
  18. OPTIONS
  19. -------
  20. *-v, --verbose*::
  21. Make *ccanlint* talkative. "-vv" doing very talkative. "-vvvv" make stupid talker.
  22. *-n, --safe-mode*::
  23. Do not compile anything. Could it be safer for the bad code, but *ccanlint*
  24. sad useless.
  25. *-l, --list-tests*::
  26. Tests show *ccanlint* can do. Then die happy.
  27. *--test-dep-graph*::
  28. Chart of all parties *ccanlint* tests 'dot(1)' Graphviz, then die happy.
  29. *-k, --keep*::
  30. *ccanlint* normally make mess temporary directory, but now it later in
  31. forensic.
  32. *-s, --summary*::
  33. *ccanlint* just realized there is no message unless you die horrible.
  34. *-x, --exclude*='TESTNAME'::
  35. No test run. Can the use of time many, many do *ccanlint* very, very quickly.
  36. Often hatred 'tests_run_valgrind' that the test slowed.
  37. *--timeout*='MILLISECONDS'::
  38. Stop the test and forget it if you take too long. Generally, the same works as
  39. '-x tests_run_valgrind'.
  40. *-t, --target*='TESTNAME'::
  41. Do not run all tests. Run this test, and the proof you need. Used many times
  42. for many tests.
  43. *--compiler*='COMPILER'::
  44. *ccanlint* read config.h about finding 'CCAN_COMPILER'. Otherwise use the default
  45. when it was built. The change, to use this compiler.
  46. *--cflags*='CFLAGS'::
  47. Set compiler options to compile. Be sure to protect spaces shell hunger.
  48. TESTS
  49. -----
  50. *ccanlint* many tests. Each test will score soon. Not total score for
  51. each test unless stupid module or no life. Worry if little or low
  52. score score after hacking.
  53. If test break, but not repair, or maybe the dumb test, put the magic
  54. lines '_info' file like this. *ccanlint* to score from 0 of 1 for
  55. test, but happy:
  56. ---------------------------------------------------------------------
  57. * Ccanlint:
  58. * // Test module foolish for me great!
  59. * info_documentation_exists FAIL
  60. * // Error for the file may be only
  61. * tests_pass_valgrind_noleaks test/run-mytest.c:FAIL
  62. ---------------------------------------------------------------------
  63. *info_exists*::
  64. CCAN module must have '_info' file describing. No this score is 0.
  65. However, *ccanlint* question may help to write one.
  66. *depends_exist*::
  67. '_info' file CCAN other module without saying, must find. It is not score 0.
  68. *objects_build*::
  69. All build purposes '.c' in the top dir. Not score 0.
  70. *module_builds*::
  71. Link to all objects in an object module. Not score 0.
  72. *depends_accurate*::
  73. Include other CCAN modules, we must say we need to '_info' depends.
  74. Only one thing allows different, you can use 'ccan/tap' for testing anyway.
  75. *depends_build*::
  76. We try to generate the CCAN module you need.
  77. *examples_exist*::
  78. Rather hope that the comments in the header, and '_info'. An
  79. example of the section in each, please! Maybe more, *ccanlint* very
  80. happy morning.
  81. *examples_relevant*::
  82. Example, do not cut and paste away! You say the name of the thing in
  83. the example or *ccanlint* unhappy.
  84. *hash_if*::
  85. Module wants *ccanlint* 'config.h' "#define HAVE_FEATURE" for all
  86. feature. Function test "#if HAVE_FEATURE" no "#ifdef HAVE_FEATURE"
  87. because user might not know about the role at all. Intelligent GCC
  88. flag '-Wundef' say HAVE_FEATURE not 0, not 1! but only if the
  89. use of '#if'.
  90. *info_documentation_exists*::
  91. '_info' file format is pretty comments. Copying someone. It is not difficult
  92. write documentation!
  93. *info_summary_single_line*::
  94. Comments from a top line often describe the function or macro. '_info' comment
  95. top line describes complete module. Characteristics make you scream!
  96. *license_exists*::
  97. The lawyers eat me. '_info' have 'License:' in the observation and LICENSE
  98. file there. In general, is the link: *ccanlint* offer create a link, if they
  99. know 'License:'.
  100. *license_comment*::
  101. Attorney everywhere. Please put a comment saying something like "GPL
  102. Version 4. Read LICENSE." in all source files in the directory.
  103. *license_file_compat*::
  104. Do not lie about the license! *ccanlint* search files, see the license
  105. of another, angry here.
  106. *license_depends_compat*::
  107. Hostile to BSD license module, but requires another module of the GPL.
  108. Perhaps poor encoder think all BSD code, unloading and damage
  109. attorney stick! Ay ay!
  110. *main_header_exists*::
  111. *ccanlint* know the module name directory name. Expect the same name for
  112. header.
  113. *headers_idempotent*::
  114. Good header '#include' many time happy. Rap header around easy.
  115. *ccanlint* say it can fix too. Always work.
  116. *main_header_compiles*::
  117. Simple program '#include' main header compile.
  118. *avoids_cpp_reserved*::
  119. C\++ programmer to include code. Not like them anyway, maybe, but wrong
  120. end your program, do mourn. Only main header compile C\++ and if
  121. trying to compile C\++ module stupid to pieces.
  122. *no_trailing_whitespace*::
  123. Linux kernel programmers more, solve the problem for the space of
  124. the final ban the line. Now all lots of hackers working to fix
  125. it. Want to famous and Linux? Leave extra space too!
  126. *examples_compile*::
  127. *ccanlint* very smart! Take 'Example:' from a comment in the header and
  128. '_info'. First try to compile anything. If not, add many
  129. headers and maybe put inside the function. It does not work, adds
  130. the latest example. If the last example has '...' try that maybe. Sometimes
  131. too complicated! '-vv' or '--keep' to see why it broke. Or maybe
  132. bad example *ccanlint* says wow!
  133. *examples_run*::
  134. If the example program that comments like '// given foo outputs bar'
  135. *ccanlint* will run the food program 'foo' in the command line and
  136. standard input. Happy if 'bar' are out. You can do ' or " about
  137. the production or determined. You can also 'output contains' more
  138. relaxed controls.
  139. *module_links*::
  140. CCAN link to the program module simply no error.
  141. *objects_build_with_stringchecks*::
  142. Module 'ccan/str' is super difficult to detect errors debugging chain.
  143. *ccanlint* use with the module and see break!
  144. *tests_exist*::
  145. You have CCAN module directory called 'test'. You have proof
  146. here. If there is no proof, *ccanlint* still offer make proof for
  147. you.
  148. *tests_compile*::
  149. In 'test' which has four such tests, start with different
  150. name. 'run' compile the test files, but no link to the module, you
  151. '#include' to get the bits of the module. 'api' test compile and
  152. link with the module. 'compile-ok' as 'run' but only build.
  153. 'compile-fail' compile, but when 'FAIL' set has to break or
  154. alert. This good for module supposed to warn.
  155. *test_helpers_compile*::
  156. Other files 'test'? Compilation of links to all tests. Ask for help.
  157. *tests_pass*::
  158. 'run' and 'api' test happy departure. If not happy, offer debugger.
  159. *tests_pass_valgrind*::
  160. *valgrind* the tool of all 'run' and 'api' slow test. However, we
  161. found many errors! If *valgrind* test rest, '_info' have *ccanlint* section,
  162. make "tests_pass_valgrind test/TESTNAME:FAIL". If required
  163. valgrind additional option, "tests_pass_valgrind test/TESTNAME:--option".
  164. *tests_pass_valgrind_noleaks*::
  165. *valgrind* complain if the memory leak test. '_info' can also be disabled.
  166. *tests_compile_coverage*::
  167. Compile 'run', 'api' test coverage. Fun if not here!
  168. *tests_coverage*::
  169. Run tests again, find lines that never try! Half of the lines 1
  170. point 3/4 getting 2 points. Limit of 5 points, but the extra point
  171. for all lines of evidence. Not win unless the module silly or use
  172. gimmick 'ccan/failtest'.
  173. *reduce_features*::
  174. Code use 'HAVE_FEATURE' make special config.h turned off. Not
  175. stupid like HAVE_BIG_ENDIAN though!
  176. *depends_build_without_features*::
  177. Make modules CCAN need. config.h but not more features.
  178. *objects_build_without_features*::
  179. Make the module again, but not more features.
  180. *tests_helpers_compile_without_features*::
  181. Helpers do try again, but not more features.
  182. *tests_compile_without_features*::
  183. Collect the tests again, but not more features.
  184. *tests_pass_without_features*:
  185. Run tests again, but not more features.
  186. BUGS
  187. ----
  188. *ccanlint* rapid change. The bad man, bad page.
  189. AUTHOR
  190. ------
  191. Rusty Russell wrote *ccanlint*. Helping others, but most break Rusty.
  192. RESOURCES
  193. ---------
  194. Main web site: http://ccodearchive.net/
  195. Wiki: https://github.com/rustyrussell/ccan/wiki/
  196. COPYING
  197. -------
  198. This program is free software; you can redistribute it and/or modify it
  199. under the terms of the GNU General Public License as published by the Free
  200. Software Foundation; either version 2 of the License, or (at your option)
  201. any later version.