1 #include <tools/ccanlint/ccanlint.h>
2 #include <ccan/tal/tal.h>
3 #include <ccan/tal/str/str.h>
13 #include <ccan/str/str.h>
14 #include <ccan/noerr/noerr.h>
16 static void check_has_main_header(struct manifest *m,
17 unsigned int *timeleft UNNEEDED,
22 list_for_each(&m->h_files, f, list) {
23 if (strstarts(f->name, m->basename)
24 && strlen(f->name) == strlen(m->basename) + 2) {
26 score->score = score->total;
30 score->error = tal_fmt(score,
31 "You have no %s/%s.h header file.\n\n"
32 "CCAN modules have a name, the same as the directory name. They're\n"
33 "expected to have an interface in the header of the same name.\n",
34 m->modname, m->basename);
37 struct ccanlint main_header_exists = {
38 .key = "main_header_exists",
39 .name = "Module has main header file",
40 .check = check_has_main_header,
44 REGISTER_TEST(main_header_exists);