From 0113843a7289ec76da54edb03c62da83a07244da Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Wed, 5 Nov 2025 08:35:18 +0000 Subject: [PATCH] Fix types for lint warnings data --- guix-data-service/model/lint-warning.scm | 63 +++++++++++++++++++----- 1 file changed, 52 insertions(+), 11 deletions(-) diff --git a/guix-data-service/model/lint-warning.scm b/guix-data-service/model/lint-warning.scm index 69241f3..4efa186 100644 --- a/guix-data-service/model/lint-warning.scm +++ b/guix-data-service/model/lint-warning.scm @@ -135,14 +135,40 @@ INNER JOIN lint_warning_messages ELSE 0 END DESC")) - (exec-query conn query `(,commit-hash - ,locale - ,@(if package-query - (list package-query) - '()) - ,@(if message-query - (list message-query) - '())))) + (map + (match-lambda + ((lint_warning_id + lint_checker_name + translated_lint_checker_description + translated_lint_checker_description_locale + lint_checker_network_dependent + package_name + package_version + location_file + location_line + location_column_number + lint_warning_message + lint_warning_message_locale) + (list lint_warning_id + lint_checker_name + translated_lint_checker_description + translated_lint_checker_description_locale + (string=? "t" lint_checker_network_dependent) + package_name + package_version + location_file + (string->number location_line) + (string->number location_column_number) + lint_warning_message + lint_warning_message_locale))) + (exec-query conn query `(,commit-hash + ,locale + ,@(if package-query + (list package-query) + '()) + ,@(if message-query + (list message-query) + '()))))) (define* (select-lint-warnings-by-revision-package-name-and-version conn commit-hash @@ -207,9 +233,24 @@ WHERE packages.id IN ( END DESC ") - (exec-query conn - query - (list commit-hash name version locale))) + (map + (match-lambda + ((lint_warning_id + lint_checkers_name translated_lint_checker_description + lint_checkers_network_dependent + location_file location_line location_column_number + lint_warning_message) + (list lint_warning_id + lint_checkers_name + translated_lint_checker_description + (string=? "t" lint_checkers_network_dependent) + location_file + (string->number location_line) + (string->number location_column_number) + lint_warning_message))) + (exec-query conn + query + (list commit-hash name version locale)))) (define (any-translated-lint-warnings? lint-warnings-data locale) (any