X-Git-Url: https://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=tools%2Fccanlint%2Ftests%2Fhas_info_documentation.c;h=cdfb0e2c63f3e29c9856887b49badbb356287722;hp=4d440e6d7cec650b91d80d86e41fd0477e299f6e;hb=6ceee26828dcb8bf1d607a8221f0d9f8261d448b;hpb=357700fd05c2cf25563a0058fd68f2ffea827e74 diff --git a/tools/ccanlint/tests/has_info_documentation.c b/tools/ccanlint/tests/has_info_documentation.c index 4d440e6d..cdfb0e2c 100644 --- a/tools/ccanlint/tests/has_info_documentation.c +++ b/tools/ccanlint/tests/has_info_documentation.c @@ -19,14 +19,15 @@ struct info_docs { bool summary; bool description; - bool example; }; -static void *check_has_info_documentation(struct manifest *m) +static void *check_has_info_documentation(struct manifest *m, + bool keep, + unsigned int *timeleft) { struct list_head *infodocs = get_ccan_file_docs(m->info_file); struct doc_section *d; - struct info_docs id = { false, false, false }; + struct info_docs id = { false, false }; list_for_each(infodocs, d, list) { if (!streq(d->function, m->basename)) @@ -35,11 +36,9 @@ static void *check_has_info_documentation(struct manifest *m) id.summary = true; if (streq(d->type, "description")) id.description = true; - if (streq(d->type, "example")) - id.example = true; } - if (id.summary && id.description && id.example) + if (id.summary && id.description) return NULL; return talloc_memdup(m, &id, sizeof(id)); } @@ -107,11 +106,6 @@ static const char *describe_has_info_documentation(struct manifest *m, "The lines after the first summary line in the _info file\n" "documentation should describe the purpose and use of the\n" "overall package\n"); - if (!id->example) - reason = talloc_asprintf_append(reason, - "Your _info file has no module example.\n\n" - "There should be an Example: section of the _info documentation\n" - "which provides a concise toy program which uses your module\n"); return reason; } @@ -119,13 +113,13 @@ static unsigned int has_info_documentation_score(struct manifest *m, void *check_result) { struct info_docs *id = check_result; - return id->summary + id->description + id->example; + return (unsigned int)id->summary + id->description; } struct ccanlint has_info_documentation = { .key = "info-documentation", .name = "Module has documentation in _info", - .total_score = 3, + .total_score = 2, .score = has_info_documentation_score, .check = check_has_info_documentation, .describe = describe_has_info_documentation,