aboutsummaryrefslogtreecommitdiff
path: root/guix-data-service/web
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2019-09-01 14:11:50 +0100
committerChristopher Baines <mail@cbaines.net>2019-09-01 18:32:09 +0100
commitbe25e487f1e97ec2e6e706c2864323e4b6ed6a22 (patch)
treef10ba76e293483a8c347f2b0f1f9f2d808ef2529 /guix-data-service/web
parent2bfd81ee1b9f1ee14d58938942409698dc40ece9 (diff)
downloaddata-service-be25e487f1e97ec2e6e706c2864323e4b6ed6a22.tar
data-service-be25e487f1e97ec2e6e706c2864323e4b6ed6a22.tar.gz
Support filtering lint warnings by linter
Diffstat (limited to 'guix-data-service/web')
-rw-r--r--guix-data-service/web/controller.scm11
-rw-r--r--guix-data-service/web/view/html.scm11
2 files changed, 14 insertions, 8 deletions
diff --git a/guix-data-service/web/controller.scm b/guix-data-service/web/controller.scm
index f7cd42f..8712121 100644
--- a/guix-data-service/web/controller.scm
+++ b/guix-data-service/web/controller.scm
@@ -344,6 +344,13 @@
`("Revision " (samp ,commit-hash)))
(header-link
(string-append "/revision/" commit-hash)))
+ (define lint-checker-options
+ (map (match-lambda
+ ((name description network-dependent)
+ (cons (string-append name ": " description )
+ name)))
+ (lint-checkers-for-revision conn commit-hash)))
+
(if (any-invalid-query-parameters? query-parameters)
(case (most-appropriate-mime-type
'(application/json text/html)
@@ -356,7 +363,7 @@
#:sxml (view-revision-lint-warnings commit-hash
query-parameters
'()
- '()
+ lint-checker-options
#:path-base path-base
#:header-text header-text
#:header-link header-link))))
@@ -406,7 +413,7 @@
query-parameters
lint-warnings
git-repositories
- '()
+ lint-checker-options
#:path-base path-base
#:header-text header-text
#:header-link header-link)
diff --git a/guix-data-service/web/view/html.scm b/guix-data-service/web/view/html.scm
index 3dc3e8f..ac3ec03 100644
--- a/guix-data-service/web/view/html.scm
+++ b/guix-data-service/web/view/html.scm
@@ -739,12 +739,11 @@
"Package query" query-parameters
#:help-text
"Lint warnings where the package name matches the query.")
- ;; TODO as there's not an easy way to find all the relevant lint checkers
- ;; ,(form-horizontal-control
- ;; "Linter" query-parameters
- ;; #:options lint-checker-options
- ;; #:help-text
- ;; "Lint warnings for specific lint checkers.")
+ ,(form-horizontal-control
+ "Linter" query-parameters
+ #:options lint-checker-options
+ #:help-text
+ "Lint warnings for specific lint checkers.")
,(form-horizontal-control
"Message query" query-parameters
#:help-text