guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

04/05: Say that there are no lint warnings


From: Christopher Baines
Subject: 04/05: Say that there are no lint warnings
Date: Mon, 23 Mar 2020 05:14:28 -0400 (EDT)

cbaines pushed a commit to branch master
in repository data-service.

commit e18f3861f84b74d7b7c4a3466fdd5c1e2ee01496
Author: Christopher Baines <address@hidden>
AuthorDate: Sat Mar 21 11:01:16 2020 +0000

    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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]