all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH 2/5] guix: lint: Use if/when consistently.
@ 2014-10-24  5:05 Eric Bavier
  2014-10-24 10:48 ` Cyril Roelandt
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Bavier @ 2014-10-24  5:05 UTC (permalink / raw)
  To: guix-devel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: 0002-guix-lint-Use-if-when-consistently.patch --]
[-- Type: text/x-diff, Size: 2288 bytes --]

From 60a9c0b0b20f37b9866f1a2825842c496ee5333d Mon Sep 17 00:00:00 2001
From: Eric Bavier <bavier@member.fsf.org>
Date: Wed, 22 Oct 2014 12:01:04 -0500
Subject: [PATCH 2/5] guix: lint: Use if/when consistently.

* guix/scripts/lint.scm (check-synopsis-style): Replace single-branch
  uses of if with when.
---
 guix/scripts/lint.scm |   28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/guix/scripts/lint.scm b/guix/scripts/lint.scm
index be866ab..84d9fe9 100644
--- a/guix/scripts/lint.scm
+++ b/guix/scripts/lint.scm
@@ -104,24 +104,24 @@
   ;; Emit a warning if stylistic issues are found in the synopsis of PACKAGE.
   (define (check-final-period synopsis)
     ;; Synopsis should not end with a period, except for some special cases.
-    (if (and (string-suffix? "." synopsis)
-             (not (string-suffix? "etc." synopsis)))
-        (emit-warning package
-                      "no period allowed at the end of the synopsis"
-                      'synopsis)))
+    (when (and (string-suffix? "." synopsis)
+               (not (string-suffix? "etc." synopsis)))
+      (emit-warning package
+                    "no period allowed at the end of the synopsis"
+                    'synopsis)))
 
   (define (check-start-article synopsis)
-    (if (or (string-prefix-ci? "A " synopsis)
-            (string-prefix-ci? "An " synopsis))
-       (emit-warning package
-                     "no article allowed at the beginning of the synopsis"
-                     'synopsis)))
+    (when (or (string-prefix-ci? "A " synopsis)
+              (string-prefix-ci? "An " synopsis))
+      (emit-warning package
+                    "no article allowed at the beginning of the synopsis"
+                    'synopsis)))
 
   (define (check-synopsis-length synopsis)
-   (if (>= (string-length synopsis) 80)
-       (emit-warning package
-                     "synopsis should be less than 80 characters long"
-                     'synopsis)))
+    (when (>= (string-length synopsis) 80)
+      (emit-warning package
+                    "synopsis should be less than 80 characters long"
+                    'synopsis)))
 
   (define (check-synopsis-start-upper-case synopsis)
    (when (and (not (string-null? synopsis))
-- 
1.7.9.5


[-- Attachment #2: Type: text/plain, Size: 17 bytes --]


-- 
Eric Bavier

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 2/5] guix: lint: Use if/when consistently.
  2014-10-24  5:05 [PATCH 2/5] guix: lint: Use if/when consistently Eric Bavier
@ 2014-10-24 10:48 ` Cyril Roelandt
  0 siblings, 0 replies; 2+ messages in thread
From: Cyril Roelandt @ 2014-10-24 10:48 UTC (permalink / raw)
  To: guix-devel

On 10/24/2014 07:05 AM, Eric Bavier wrote:
> From 60a9c0b0b20f37b9866f1a2825842c496ee5333d Mon Sep 17 00:00:00 2001
> From: Eric Bavier <bavier@member.fsf.org>
> Date: Wed, 22 Oct 2014 12:01:04 -0500
> Subject: [PATCH 2/5] guix: lint: Use if/when consistently.
> 
> * guix/scripts/lint.scm (check-synopsis-style): Replace single-branch
>   uses of if with when.
> ---
>  guix/scripts/lint.scm |   28 ++++++++++++++--------------
>  1 file changed, 14 insertions(+), 14 deletions(-)

Looks good to me.

Cyril.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-10-24 10:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-24  5:05 [PATCH 2/5] guix: lint: Use if/when consistently Eric Bavier
2014-10-24 10:48 ` Cyril Roelandt

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.