]> git.ozlabs.org Git - ccan/blobdiff - tools/ccanlint/ccanlint.c
ccanlint: check examples actually mention thing they are demonstrating.
[ccan] / tools / ccanlint / ccanlint.c
index 6bfc6d15bd1debf7ad7355da0ce3ba2181e2dde8..8acad9329e4c7280d0fef58eb8b833cf9ca7cd72 100644 (file)
@@ -149,26 +149,8 @@ static bool run_test(struct ccanlint *i,
        }
 
        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)