X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=tools%2Fccanlint%2Ftests%2Fhas_info_documentation.c;h=2823e66b6700b10536838234604761c316f4ef96;hb=b8d05b195bfa10cb2a5b21985536ea45350029d5;hp=9233e2883d7229acb3e132659cf36fd00339a5b6;hpb=501b31cddfaa3e8a4374dc84f6f75d07dd2d0abb;p=ccan diff --git a/tools/ccanlint/tests/has_info_documentation.c b/tools/ccanlint/tests/has_info_documentation.c index 9233e288..2823e66b 100644 --- a/tools/ccanlint/tests/has_info_documentation.c +++ b/tools/ccanlint/tests/has_info_documentation.c @@ -1,5 +1,6 @@ #include #include +#include #include #include #include @@ -21,7 +22,9 @@ struct info_docs 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; @@ -81,7 +84,7 @@ static void create_info_template_doc(struct manifest *m, void *check_result) unlink_noerr("_info.new"); err(1, "Closing _info.new"); } - if (rename("_info.new", "_info") != 0) { + if (!move_file("_info.new", "_info")) { unlink_noerr("_info.new"); err(1, "Renaming _info.new to _info"); } @@ -122,7 +125,8 @@ static unsigned int has_info_documentation_score(struct manifest *m, } struct ccanlint has_info_documentation = { - .name = "Documentation in _info file", + .key = "info-documentation", + .name = "Module has documentation in _info", .total_score = 3, .score = has_info_documentation_score, .check = check_has_info_documentation,