From e18f3861f84b74d7b7c4a3466fdd5c1e2ee01496 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Sat, 21 Mar 2020 11:01:16 +0000 Subject: [PATCH] Say that there are no lint warnings Rather than having an empty table. --- guix-data-service/web/revision/html.scm | 88 ++++++++++++++----------- 1 file changed, 48 insertions(+), 40 deletions(-) diff --git a/guix-data-service/web/revision/html.scm b/guix-data-service/web/revision/html.scm index a199197..b03d59e 100644 --- a/guix-data-service/web/revision/html.scm +++ b/guix-data-service/web/revision/html.scm @@ -280,46 +280,54 @@ (th "Message") (th "Location"))) (tbody - ,@(map - (match-lambda - ((id lint-checker-name lint-checker-description - lint-checker-network-dependent - file line-number column-number - message) - `(tr - (td (span (@ (style "font-family: monospace; display: block;")) - ,lint-checker-name) - (p (@ (style "font-size: small; margin: 6px 0 0px;")) - ,lint-checker-description)) - (td ,message) - (td - ,@(if (and file (not (string-null? file))) - `((ul - (@ (class "list-unstyled")) - ,@(map - (match-lambda - ((id label url cgit-url-base) - (let ((output - `(,file - " " - (span - (@ (style "white-space: nowrap")) - "(line: " ,line-number - ", column: " ,column-number ")")))) - (if - (and cgit-url-base - (not (string-null? cgit-url-base))) - `(li - (a (@ (href - ,(string-append - cgit-url-base "tree/" - file "?id=" revision-commit-hash - "#n" line-number))) - ,@output)) - `(li ,@output))))) - git-repositories))) - '()))))) - lint-warnings))))))))) + ,@(if (null? lint-warnings) + `((tr + (td (@ (colspan 3) + (align "center")) + "No lint warnings " + (span + (@ (class "label label-success")) + "✓")))) + (map + (match-lambda + ((id lint-checker-name lint-checker-description + lint-checker-network-dependent + file line-number column-number + message) + `(tr + (td (span (@ (style "font-family: monospace; display: block;")) + ,lint-checker-name) + (p (@ (style "font-size: small; margin: 6px 0 0px;")) + ,lint-checker-description)) + (td ,message) + (td + ,@(if (and file (not (string-null? file))) + `((ul + (@ (class "list-unstyled")) + ,@(map + (match-lambda + ((id label url cgit-url-base) + (let ((output + `(,file + " " + (span + (@ (style "white-space: nowrap")) + "(line: " ,line-number + ", column: " ,column-number ")")))) + (if + (and cgit-url-base + (not (string-null? cgit-url-base))) + `(li + (a (@ (href + ,(string-append + cgit-url-base "tree/" + file "?id=" revision-commit-hash + "#n" line-number))) + ,@output)) + `(li ,@output))))) + git-repositories))) + '()))))) + lint-warnings)))))))))) (define (view-revision/git-repositories git-repositories-and-branches commit-hash)