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