]> git.ozlabs.org Git - ccan/blobdiff - tools/ccanlint/tests/no_trailing_whitespace.c
ccanlint: exit with non-zero exit status if a test fails.
[ccan] / tools / ccanlint / tests / no_trailing_whitespace.c
index a66fd74c3c57a8fdd7f42f352975bbe681366665..f046a248cc3e8bcfa818c9f213ca022efa2ad397 100644 (file)
@@ -30,21 +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->error = "Trailing whitespace"
-                                               " found";
-                                       score_file_error(score, f, i+1, err);
-                               }
+                               if (err)
+                                       score_file_error(score, f, i+1,
+                                                        "%s", err);
                        }
                }
        }
        if (!score->error) {
-               score->pass = true;
                score->score = score->total;
        }
 }