-
-
Notifications
You must be signed in to change notification settings - Fork 44
Expand file tree
/
Copy pathlint.sls
More file actions
35 lines (31 loc) · 1016 Bytes
/
lint.sls
File metadata and controls
35 lines (31 loc) · 1016 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
(library (lint)
(export check-config-for)
(import (outils)
(chezscheme))
(define checkworthy-fields
'(uuid
core
unlocked-by
difficulty
topics))
(define (check-config field problem-config)
(unless (assoc field problem-config)
(format #t "~a~%~%" problem-config)
(error 'check-for-field "please add field" field problem-config))
'ok)
(define (check-config-for problem)
(format #t "checking config for ~a~%" problem)
(let ((exercisms (lookup 'exercises (load-config))))
(cond ((find (lambda (exercism)
(eq? problem (lookup 'slug exercism)))
exercisms)
=>
(lambda (config)
(for-all (lambda (field)
(check-config field config))
checkworthy-fields)))
(else
(error 'check-config-for
"please add problem to config/config.ss"
problem)))))
)