]> git.ozlabs.org Git - ccan/blobdiff - tools/ccanlint/tests/no_trailing_whitespace.c
ccanlint: get rid of separate class of compulsory tests.
[ccan] / tools / ccanlint / tests / no_trailing_whitespace.c
index 1018be3cd64938788a47019f71b11c832755fa8b..5d3b5ca19d0b10f1b76fbda3fd2cdfcaa72426b7 100644 (file)
@@ -30,18 +30,21 @@ static void check_trailing_whitespace(struct manifest *m,
        struct ccan_file *f;
        unsigned int i;
 
+       /* We don't fail ccanlint for this. */
+       score->pass = true;
+
        foreach_ptr(list, &m->c_files, &m->h_files) {
                list_for_each(list, f, list) {
                        char **lines = get_ccan_file_lines(f);
                        for (i = 0; i < f->num_lines; i++) {
                                char *err = get_trailing_whitespace(lines[i]);
                                if (err)
-                                       score_file_error(score, f, i+1, err);
+                                       score_file_error(score, f, i+1,
+                                                        "%s", err);
                        }
                }
        }
        if (!score->error) {
-               score->pass = true;
                score->score = score->total;
        }
 }
@@ -50,7 +53,7 @@ struct ccanlint no_trailing_whitespace = {
        .key = "no_trailing_whitespace",
        .name = "Module's source code has no trailing whitespace",
        .check = check_trailing_whitespace,
-       .needs = ""
+       .needs = "info_exists"
 };