me
/
guix
Archived
1
0
Fork 0

lint: Change checker names to be symbols.

* guix/scripts/lint.scm (%checkers): Change 'name' fields to be
  symbols.
  (%options): Adjust "-c" option handler accordingly.
master
Ludovic Courtès 2014-11-19 22:37:29 +01:00
parent 37627ffa89
commit f4d5bca39e
1 changed files with 10 additions and 9 deletions

View File

@ -278,23 +278,23 @@ descriptions maintained upstream."
(define %checkers (define %checkers
(list (list
(lint-checker (lint-checker
(name "description") (name 'description)
(description "Validate package descriptions") (description "Validate package descriptions")
(check check-description-style)) (check check-description-style))
(lint-checker (lint-checker
(name "gnu-description") (name 'gnu-description)
(description "Validate synopsis & description of GNU packages") (description "Validate synopsis & description of GNU packages")
(check check-gnu-synopsis+description)) (check check-gnu-synopsis+description))
(lint-checker (lint-checker
(name "inputs-should-be-native") (name 'inputs-should-be-native)
(description "Identify inputs that should be native inputs") (description "Identify inputs that should be native inputs")
(check check-inputs-should-be-native)) (check check-inputs-should-be-native))
(lint-checker (lint-checker
(name "patch-filenames") (name 'patch-filenames)
(description "Validate filenames of patches") (description "Validate filenames of patches")
(check check-patches)) (check check-patches))
(lint-checker (lint-checker
(name "synopsis") (name 'synopsis)
(description "Validate package synopsis") (description "Validate package synopsis")
(check check-synopsis-style)))) (check check-synopsis-style))))
@ -336,11 +336,12 @@ Run a set of checkers on the specified package; if none is specified, run the ch
;; 'certainty'. ;; 'certainty'.
(list (option '(#\c "checkers") #t #f (list (option '(#\c "checkers") #t #f
(lambda (opt name arg result arg-handler) (lambda (opt name arg result arg-handler)
(let ((names (string-split arg #\,))) (let ((names (map string->symbol (string-split arg #\,))))
(for-each (lambda (c) (for-each (lambda (c)
(when (not (member c (map lint-checker-name (unless (memq c
%checkers))) (map lint-checker-name
(leave (_ "~a: invalid checker") c))) %checkers))
(leave (_ "~a: invalid checker~%") c)))
names) names)
(values (alist-cons 'checkers (values (alist-cons 'checkers
(filter (lambda (checker) (filter (lambda (checker)