aboutsummaryrefslogtreecommitdiff
path: root/guix-data-service/model/lint-checker.scm
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2019-08-31 12:11:58 +0100
committerChristopher Baines <mail@cbaines.net>2019-09-01 13:12:10 +0100
commit6b9977f62eef54678c7a53844ad5d26d8efeecb0 (patch)
treed76ededb17ec03e0705258bb9565782c7e16af76 /guix-data-service/model/lint-checker.scm
parentbf469504eb4df95a3349328dc10095d172630fcd (diff)
downloaddata-service-6b9977f62eef54678c7a53844ad5d26d8efeecb0.tar
data-service-6b9977f62eef54678c7a53844ad5d26d8efeecb0.tar.gz
Store lint warnings in the database
This commit adds the relevant tables and code to store lint warnings in the database. Currently, only lint checkers which don't require access to the network will be run, as this allows the processing to happen without network access. Also, this functionality won't work in older versions of Guix which don't expose the lint warnings in a compatible way.
Diffstat (limited to 'guix-data-service/model/lint-checker.scm')
-rw-r--r--guix-data-service/model/lint-checker.scm15
1 files changed, 15 insertions, 0 deletions
diff --git a/guix-data-service/model/lint-checker.scm b/guix-data-service/model/lint-checker.scm
new file mode 100644
index 0000000..6193966
--- /dev/null
+++ b/guix-data-service/model/lint-checker.scm
@@ -0,0 +1,15 @@
+(define-module (guix-data-service model lint-checker)
+ #:use-module (srfi srfi-1)
+ #:use-module (ice-9 match)
+ #:use-module (guix-data-service model utils)
+ #:export (lint-checkers->lint-checker-ids))
+
+(define (lint-checkers->lint-checker-ids conn lint-checkers-data)
+ (insert-missing-data-and-return-all-ids
+ conn
+ "lint_checkers"
+ `((name . ,(lambda (value)
+ (quote-string (symbol->string value))))
+ (description . ,quote-string)
+ (network_dependent . ,value->sql-boolean))
+ lint-checkers-data))