X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=tools%2Fccanlint%2Fccanlint.c;h=8acad9329e4c7280d0fef58eb8b833cf9ca7cd72;hb=0e89f234c8cd7dbebcd619979383f826ec95c72c;hp=7515a7c6f7af15eebe184699c3e731a7ce37c555;hpb=016a19d260cd7f4afeb5b2b2cc28c8bbed1cd170;p=ccan diff --git a/tools/ccanlint/ccanlint.c b/tools/ccanlint/ccanlint.c index 7515a7c6..8acad932 100644 --- a/tools/ccanlint/ccanlint.c +++ b/tools/ccanlint/ccanlint.c @@ -142,33 +142,15 @@ static bool run_test(struct ccanlint *i, if ((!score->pass && !quiet) || (score->score < score->total && verbose) || verbose > 1) { - printf("%s: %s", i->name, score->pass ? "PASS" : "FAIL"); + printf("%s (%s): %s", i->name, i->key, score->pass ? "PASS" : "FAIL"); if (score->total > 1) printf(" (+%u/%u)", score->score, score->total); printf("\n"); } if ((!quiet && !score->pass) || verbose) { - struct file_error *f; - unsigned int lines = 1; - if (score->error) - printf("%s%s\n", score->error, - list_empty(&score->per_file_errors) ? "" : ":"); - - list_for_each(&score->per_file_errors, f, list) { - if (f->line) - printf("%s:%u:%s\n", - f->file->fullname, f->line, f->error); - else if (f->file) - printf("%s:%s\n", f->file->fullname, f->error); - else - printf("%s\n", f->error); - if (verbose < 2 && ++lines > 5) { - printf("... more (use -vv to see them all)\n"); - break; - } - } + printf("%s", score->error); if (!quiet && !score->pass && i->handle) i->handle(m, score); } @@ -517,6 +499,8 @@ int main(int argc, char *argv[]) if (dir[0] != '/') dir = talloc_asprintf_append(NULL, "%s/%s", base_dir, dir); + while (strends(dir, "/")) + dir[strlen(dir)-1] = '\0'; if (dir != base_dir) prefix = talloc_append_string(talloc_basename(NULL, dir), ": "); if (verbose >= 3)