guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

04/07: lint: Change checker names to be symbols.


From: Ludovic Courtès
Subject: 04/07: lint: Change checker names to be symbols.
Date: Wed, 19 Nov 2014 21:53:57 +0000

civodul pushed a commit to branch master
in repository guix.

commit f4d5bca39ec4b78993347e60c1d3d0971643f5a6
Author: Ludovic Courtès <address@hidden>
Date:   Wed Nov 19 22:37:29 2014 +0100

    lint: Change checker names to be symbols.
    
    * guix/scripts/lint.scm (%checkers): Change 'name' fields to be
      symbols.
      (%options): Adjust "-c" option handler accordingly.
---
 guix/scripts/lint.scm |   19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/guix/scripts/lint.scm b/guix/scripts/lint.scm
index facc2bf..dd2584b 100644
--- a/guix/scripts/lint.scm
+++ b/guix/scripts/lint.scm
@@ -278,23 +278,23 @@ descriptions maintained upstream."
 (define %checkers
   (list
    (lint-checker
-     (name        "description")
+     (name        'description)
      (description "Validate package descriptions")
      (check       check-description-style))
    (lint-checker
-     (name        "gnu-description")
+     (name        'gnu-description)
      (description "Validate synopsis & description of GNU packages")
      (check       check-gnu-synopsis+description))
    (lint-checker
-     (name        "inputs-should-be-native")
+     (name        'inputs-should-be-native)
      (description "Identify inputs that should be native inputs")
      (check       check-inputs-should-be-native))
    (lint-checker
-     (name        "patch-filenames")
+     (name        'patch-filenames)
      (description "Validate filenames of patches")
      (check       check-patches))
    (lint-checker
-     (name        "synopsis")
+     (name        'synopsis)
      (description "Validate package synopsis")
      (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'.
   (list (option '(#\c "checkers") #t #f
                 (lambda (opt name arg result arg-handler)
-                  (let ((names (string-split arg #\,)))
+                  (let ((names (map string->symbol (string-split arg #\,))))
                     (for-each (lambda (c)
-                                (when (not (member c (map lint-checker-name
-                                                          %checkers)))
-                                  (leave (_ "~a: invalid checker") c)))
+                                (unless (memq c
+                                              (map lint-checker-name
+                                                   %checkers))
+                                  (leave (_ "~a: invalid checker~%") c)))
                               names)
                     (values (alist-cons 'checkers
                              (filter (lambda (checker)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]