1 #include <tools/ccanlint/ccanlint.h>
2 #include <ccan/foreach/foreach.h>
13 static void check_license_depends_compat(struct manifest *m,
14 unsigned int *timeleft UNNEEDED,
21 /* If our license is unknown, we can't know the answer. */
22 if (m->license == LICENSE_UNKNOWN) {
23 score->score = score->total = 0;
27 list_for_each(&m->deps, i, list) {
28 struct doc_section *d = find_license_tag(i);
29 i->license = which_license(d);
31 if (i->license != LICENSE_UNKNOWN
32 && !license_compatible[m->license][i->license]) {
33 score_file_error(score, i->info_file, 0,
34 "Dependency ccan/%s has"
35 " incompatible license '%s'",
37 licenses[i->license].name);
43 score->score = score->total;
46 struct ccanlint license_depends_compat = {
47 .key = "license_depends_compat",
48 .name = "CCAN dependencies don't contain incompatible licenses",
49 .check = check_license_depends_compat,
50 .needs = "license_exists depends_exist"
52 REGISTER_TEST(license_depends_compat);