]> git.ozlabs.org Git - ccan/blobdiff - tools/ccanlint/tests/trailing_whitespace.c
ccanlint: use familiar names for temporary files, show them with -vv.
[ccan] / tools / ccanlint / tests / trailing_whitespace.c
index f5bf5b9fec7f2be5929c25d085926d6b174fd585..439fc06d1b67907bf5096a2c4457afb89a533a6a 100644 (file)
@@ -3,6 +3,7 @@
 #include <ccan/talloc/talloc.h>
 #include <ccan/str/str.h>
 
+/* FIXME: only print full analysis if verbose >= 2.  */
 static char *report_on_trailing_whitespace(const char *line)
 {
        const char *e = strchr(line, 0);
@@ -19,7 +20,9 @@ static char *report_on_trailing_whitespace(const char *line)
        return talloc_asprintf(line, "'%s'", line);
 }
 
-static void *check_trailing_whitespace(struct manifest *m)
+static void *check_trailing_whitespace(struct manifest *m,
+                                      bool keep,
+                                      unsigned int *timeleft)
 {
        char *report;
 
@@ -34,6 +37,8 @@ static void *check_trailing_whitespace(struct manifest *m)
 static const char *describe_trailing_whitespace(struct manifest *m,
                                                void *check_result)
 {
+       if (!verbose)
+               return NULL;
        return talloc_asprintf(check_result, 
                               "Some source files have trailing whitespace:\n"
                               "%s", (char *)check_result);
@@ -41,7 +46,7 @@ static const char *describe_trailing_whitespace(struct manifest *m,
 
 struct ccanlint trailing_whitespace = {
        .key = "trailing-whitespace",
-       .name = "No lines with unnecessary trailing whitespace",
+       .name = "Module's source code has no trailing whitespace",
        .total_score = 1,
        .check = check_trailing_whitespace,
        .describe = describe_trailing_whitespace,