aboutsummaryrefslogtreecommitdiff
path: root/guix-data-service/web
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2022-08-22 17:42:37 +0100
committerChristopher Baines <mail@cbaines.net>2022-08-22 17:42:37 +0100
commit1043b51bff6beb8760f33489890ac972e95a15b1 (patch)
tree4b3151aa4a9ed6fcda98f1c3771fb96b1343456e /guix-data-service/web
parentee73d2cc9857533020535eb8e1ad856e04fb5152 (diff)
downloaddata-service-1043b51bff6beb8760f33489890ac972e95a15b1.tar
data-service-1043b51bff6beb8760f33489890ac972e95a15b1.tar.gz
Include lint warnings in the JSON /compare response
Diffstat (limited to 'guix-data-service/web')
-rw-r--r--guix-data-service/web/compare/controller.scm36
1 files changed, 35 insertions, 1 deletions
diff --git a/guix-data-service/web/compare/controller.scm b/guix-data-service/web/compare/controller.scm
index bbc9829..b0ae639 100644
--- a/guix-data-service/web/compare/controller.scm
+++ b/guix-data-service/web/compare/controller.scm
@@ -357,7 +357,41 @@
((name data ...)
`((name . ,name)
,@data)))
- version-changes))))
+ version-changes)))
+ (lint_warnings
+ . ,(list->vector
+ (map
+ (match-lambda
+ (((package-name package-version)
+ . warnings)
+
+ `((package
+ . ((name . ,package-name)
+ (version . ,package-version)))
+ (warnings
+ . ,(list->vector
+ (map
+ (match-lambda
+ ((lint-checker-name
+ message
+ lint-checker-description
+ lint-checker-network-dependent
+ file line column-number
+ change)
+
+ `((change . ,change)
+ (checker
+ . ((name . ,lint-checker-name)
+ (description
+ . ,lint-checker-description)))
+ (message . ,message)
+ (location
+ . ((file . ,file)
+ (line . ,(string->number line))
+ (column . ,(string->number
+ column-number)))))))
+ warnings))))))
+ lint-warnings-data))))
#:extra-headers http-headers-for-unchanging-content))
(else
(letpar& ((lint-warnings-locale-options