]> git.ozlabs.org Git - ccan/blobdiff - tools/ccanlint/ccanlint.c
ccanlint: fix trailing / in -d.
[ccan] / tools / ccanlint / ccanlint.c
index 7515a7c6f7af15eebe184699c3e731a7ce37c555..8acad9329e4c7280d0fef58eb8b833cf9ca7cd72 100644 (file)
@@ -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)