GNU bug report logs - #33575
[PATCH] guix: lint: Add checker to check if inputs are sorted.

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix-patches; Reported by: Arun Isaac <arunisaac@HIDDEN>; Keywords: patch; dated Sun, 2 Dec 2018 07:43:02 UTC; Maintainer for guix-patches is guix-patches@HIDDEN.

Message received at 33575 <at> debbugs.gnu.org:


Received: (at 33575) by debbugs.gnu.org; 6 Dec 2018 12:31:41 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Dec 06 07:31:41 2018
Received: from localhost ([127.0.0.1]:35005 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gUsoa-00085z-MK
	for submit <at> debbugs.gnu.org; Thu, 06 Dec 2018 07:31:41 -0500
Received: from mx1.riseup.net ([198.252.153.129]:33897)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <swedebugia@HIDDEN>) id 1gUsoT-00080Q-FW
 for 33575 <at> debbugs.gnu.org; Thu, 06 Dec 2018 07:31:34 -0500
Received: from cotinga.riseup.net (cotinga-pn.riseup.net [10.0.1.164])
 (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
 (Client CN "*.riseup.net",
 Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK))
 by mx1.riseup.net (Postfix) with ESMTPS id 9914D1A048C;
 Thu,  6 Dec 2018 04:31:28 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak;
 t=1544099488; bh=ECSeLqU2X6nPCRcR8PzTAIjmT2BHtXEeCh1Mv1cGywc=;
 h=Date:From:To:Cc:Subject:In-Reply-To:References:From;
 b=PVTefeqzr1NntWvJEYbD7A6y+Teq1IptYxkYnKv1hfAGGo4NA6QssxERcrPGvgVcJ
 OoThSnottEwv8bGhuSq5xPM89Ptul/4EbN4qhZhNKKbor6KXxVo/fFROmrHwhseFxS
 cQCQnkDlVe4tnSteEBDhoDikcTi7m4CQP64Ck1Ls=
X-Riseup-User-ID: 48414DF7AE12CCABB21AA9408DD732D5D1F309D1B411595341A0BE3FA428F1AF
Received: from [127.0.0.1] (localhost [127.0.0.1])
 by cotinga.riseup.net with ESMTPSA id 30FE78F916;
 Thu,  6 Dec 2018 04:31:28 -0800 (PST)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Date: Thu, 06 Dec 2018 04:31:28 -0800
From: swedebugia@HIDDEN
To: Oleg Pykhalov <go.wigust@HIDDEN>
Subject: Re: [bug#33575] [PATCH] guix: lint: Add checker to check if inputs
 are sorted.
In-Reply-To: <87k1knpjta.fsf@HIDDEN>
References: <20181202074210.31361-1-arunisaac@HIDDEN>
 <87y3967n3z.fsf@HIDDEN> <87k1knpjta.fsf@HIDDEN>
Message-ID: <1f7a7e5589c465c0ad913b388374cf4b@HIDDEN>
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 33575
Cc: 33575 <at> debbugs.gnu.org,
 Guix-patches <guix-patches-bounces+swedebugia=riseup.net@HIDDEN>,
 ludo@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

On 2018-12-06 01:42, Oleg Pykhalov wrote:
> Hello,
> 
> ludo@HIDDEN (Ludovic Courtès) writes:
> 
> […]
> 
>> It’s something we rarely do so we’d get warnings for most packages.  As
>> a side effect, people may pay less attention to what ‘guix lint’ says.
> 
> I think this should not stop us from improving a linter and an option
> like --misc-checks=sort-input,foo,bar could be used for such cases.

I agree with Oleg here. 

If many packages needs inputs to be sorted lets write a guix lint --sort
modelling the updater (that is make the changes in the work tree to be
committed). 

-- 
Cheers 
Swedebugia




Information forwarded to guix-patches@HIDDEN:
bug#33575; Package guix-patches. Full text available.

Message received at 33575 <at> debbugs.gnu.org:


Received: (at 33575) by debbugs.gnu.org; 6 Dec 2018 00:42:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Dec 05 19:42:53 2018
Received: from localhost ([127.0.0.1]:34785 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gUhkd-0004AN-AO
	for submit <at> debbugs.gnu.org; Wed, 05 Dec 2018 19:42:52 -0500
Received: from mail-pf1-f174.google.com ([209.85.210.174]:33900)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <go.wigust@HIDDEN>) id 1gUhkX-0004A6-O5
 for 33575 <at> debbugs.gnu.org; Wed, 05 Dec 2018 19:42:45 -0500
Received: by mail-pf1-f174.google.com with SMTP id h3so10870345pfg.1
 for <33575 <at> debbugs.gnu.org>; Wed, 05 Dec 2018 16:42:41 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:to:cc:subject:references:date:in-reply-to:message-id
 :user-agent:mime-version;
 bh=8Yi8OVmv6ooDb+uC2QBuhxoQiAIjba+H5YSq6yWCJds=;
 b=dAMRd9XuPjYirTAwq0vrYZudAg7SQQmWSCOQcDvSgZHrSHnBFzDMQrCe8ktm+97U2d
 UcjCRsCDfGzz5VS7Y6uYQoLjh+yxxKJ2Nan9XIdL+ZJzXlq00WnBdiOYNlljHq8Tig5A
 t0f4GtMVCmjwXHe24PRrtpRftHfJQV9xMiGOSYOYnj2SAMQbDfnj7zO8djW1yhKGDZss
 QDBMx/7bTD6EZbG3mykkjIIqfeEVzYPiHYdcL+B9pK6X+2Rvj6ceH2KN4WJF99Q9rsOK
 E552uWbPazb7VAhj2bTNyUhbUBbZHW+1/KQEc0wcHRTl5KHdMQ6HMVlYIcuXy/UrreQ4
 jTiw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to
 :message-id:user-agent:mime-version;
 bh=8Yi8OVmv6ooDb+uC2QBuhxoQiAIjba+H5YSq6yWCJds=;
 b=aHmEclt9XRS95xgRMzJRa9fNLJK2gteajh8dAn91F6MaxUQZEX2hZ9EC3O3bFqIsPY
 pMJI057C+Ce5oBC5lopcsUePopVr4/OTgu4vP94ul1oivAL2xBA1EJ3j2+P5vn+dVtV5
 I3WWBWc8DM8phGe5L7gjkXRoNnj2NYShTKc52KmAQ8ja8lBZVOOMQSHyeAKURn6MEook
 XckK95lqG1So9kmwKhwTbUZYvQ6/2elMHVjxSmNNCSTUXxckVUz0W5qUHOSFQa1gqaqk
 6tEP+WSL1fWbWqkEYkzlXvUqIV6NfL/AXq4Ul269HgZVMIlNopgSUhDNox9fh9yYClwP
 WJTg==
X-Gm-Message-State: AA+aEWYOvvwSU0dEK5jgLwPQAcHjEsnm898XHaLKgA8szKpE/3eiidnY
 hooacCmquzRgBK5v3yZqX4FJ6qHpX5k+ZA==
X-Google-Smtp-Source: AFSGD/VjPKj7SzTEPTHjBFuniyU7CjDXm6mN71XlNkX9Tn6epoHMxdDBsk2Ntmko0bj8/7ws+u/2GA==
X-Received: by 2002:a62:29c3:: with SMTP id
 p186mr26937462pfp.117.1544056955485; 
 Wed, 05 Dec 2018 16:42:35 -0800 (PST)
Received: from magnolia (95-55-112-238.dynamic.avangarddsl.ru. [95.55.112.238])
 by smtp.gmail.com with ESMTPSA id r130sm33700197pfr.48.2018.12.05.16.42.32
 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
 Wed, 05 Dec 2018 16:42:34 -0800 (PST)
From: Oleg Pykhalov <go.wigust@HIDDEN>
To: ludo@HIDDEN (Ludovic =?utf-8?Q?Court=C3=A8s?=)
Subject: Re: [bug#33575] [PATCH] guix: lint: Add checker to check if inputs
 are sorted.
References: <20181202074210.31361-1-arunisaac@HIDDEN>
 <87y3967n3z.fsf@HIDDEN>
Date: Thu, 06 Dec 2018 03:42:25 +0300
In-Reply-To: <87y3967n3z.fsf@HIDDEN> ("Ludovic
 \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\=
 \=\?utf-8\?Q\?s\?\= message of "Mon, 03 Dec 2018 14:31:44 +0100")
Message-ID: <87k1knpjta.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-=";
 micalg=pgp-sha512; protocol="application/pgp-signature"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 33575
Cc: 33575 <at> debbugs.gnu.org, Arun Isaac <arunisaac@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Hello,

ludo@HIDDEN (Ludovic Court=C3=A8s) writes:

[=E2=80=A6]

> It=E2=80=99s something we rarely do so we=E2=80=99d get warnings for most=
 packages.  As
> a side effect, people may pay less attention to what =E2=80=98guix lint=
=E2=80=99 says.

I think this should not stop us from improving a linter and an option
like --misc-checks=3Dsort-input,foo,bar could be used for such cases.

[=E2=80=A6]

Oleg.

--=-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEcjhxI46s62NFSFhXFn+OpQAa+pwFAlwIcHEACgkQFn+OpQAa
+pyBnhAAicRVr9oSkGLOEMlUMqbkj3J3F3j7VbY1c5QCxnD7TOC3GqaaeowLz/OT
W6KSQFFvqSZGeJKhRejA2Fkrgh5HAr24+zQxJPqJqn+mtc4O/7Oga5oM/8IJ4frP
v6q82YJGaAaE0rTHpiB696L4Ie1IKYCMrHQe3ZwWdum/DA47wU6e+yL+3qI6/zWX
vP773ts07wQMn0jL3a69Y/7eFHh/tXJUdrrSdV5IRiuFFDPKIgVG58foGG2BBCsu
0qPknTPk3YURsQ7sV9HXxQQmx6XRJl8tuNWTM9CRrL6H7JkPiFJfFU1ijO8CtCpx
O+NkrgAAuOuV40Y/+IdSOa6oNVusE93DS+DQPa70mEgys8ftwERJK6Ln+e1fbc/g
ETTEIWIYfKyJcbOq0tykfy7UFSnJEvtHk/VgZB4pCO2TTameR7MmiW+x6PcslBXm
L0c+65DlHGrvsXm97bczZiEzNEsERFDJklyxgW7gi466KjpkF52FFRvJiihxfqW5
fKc/f1tAeDz2e+ZgqNNRucdX3AAMw+pNJJ6DGPcE1dy8VeD7SHwY4aohDxeexRjW
Slol9vZtg9U7RjziSTRbhp+aFDkzdnJkZtlZsNd+AnJNSVCxmkq7WFzFvjoHMELk
hwhV/FQvi9rmfiI6gKUqe3TXBk536HL4OshpCC6/iduHHW9LXYk=
=+G1B
-----END PGP SIGNATURE-----
--=-=-=--




Information forwarded to guix-patches@HIDDEN:
bug#33575; Package guix-patches. Full text available.

Message received at 33575 <at> debbugs.gnu.org:


Received: (at 33575) by debbugs.gnu.org; 3 Dec 2018 13:31:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Dec 03 08:31:59 2018
Received: from localhost ([127.0.0.1]:58754 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gToKN-0002HE-FG
	for submit <at> debbugs.gnu.org; Mon, 03 Dec 2018 08:31:59 -0500
Received: from eggs.gnu.org ([208.118.235.92]:49264)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1gToKJ-0002Gy-UQ
 for 33575 <at> debbugs.gnu.org; Mon, 03 Dec 2018 08:31:57 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <ludo@HIDDEN>) id 1gToKD-0007C7-JR
 for 33575 <at> debbugs.gnu.org; Mon, 03 Dec 2018 08:31:50 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20 autolearn=disabled
 version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:54085)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <ludo@HIDDEN>)
 id 1gToKD-0007Bz-GC; Mon, 03 Dec 2018 08:31:49 -0500
Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=54892 helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <ludo@HIDDEN>)
 id 1gToKD-0001Tu-4A; Mon, 03 Dec 2018 08:31:49 -0500
From: ludo@HIDDEN (Ludovic =?utf-8?Q?Court=C3=A8s?=)
To: Arun Isaac <arunisaac@HIDDEN>
Subject: Re: [bug#33575] [PATCH] guix: lint: Add checker to check if inputs
 are sorted.
References: <20181202074210.31361-1-arunisaac@HIDDEN>
Date: Mon, 03 Dec 2018 14:31:44 +0100
In-Reply-To: <20181202074210.31361-1-arunisaac@HIDDEN> (Arun Isaac's
 message of "Sun, 2 Dec 2018 13:12:10 +0530")
Message-ID: <87y3967n3z.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 33575
Cc: 33575 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -6.0 (------)

Hello,

Arun Isaac <arunisaac@HIDDEN> skribis:

> * guix/scripts/lint.scm (check-inputs-should-be-sorted): New procedure.
> (%checkers): Add it.
> ---
>  guix/scripts/lint.scm | 21 +++++++++++++++++++++
>  1 file changed, 21 insertions(+)
>
> diff --git a/guix/scripts/lint.scm b/guix/scripts/lint.scm
> index 2314f3b28..37e8a1ec5 100644
> --- a/guix/scripts/lint.scm
> +++ b/guix/scripts/lint.scm
> @@ -8,6 +8,7 @@
>  ;;; Copyright =C2=A9 2017 Alex Kost <alezost@HIDDEN>
>  ;;; Copyright =C2=A9 2017 Tobias Geerinckx-Rice <me@HIDDEN>
>  ;;; Copyright =C2=A9 2017 Efraim Flashner <efraim@HIDDEN>
> +;;; Copyright =C2=A9 2018 Arun Isaac <arunisaac@HIDDEN>
>  ;;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -301,6 +302,22 @@ of a package, and INPUT-NAMES, a list of package spe=
cifications such as
>                (package-input-intersection (package-direct-inputs package)
>                                            input-names))))
>=20=20
> +(define (check-inputs-should-be-sorted package)
> +  ;; Emit a warning if inputs, native inputs or propagated inputs of PAC=
KAGE
> +  ;; are not lexicographically ordered.

It=E2=80=99s something we rarely do so we=E2=80=99d get warnings for most p=
ackages.  As
a side effect, people may pay less attention to what =E2=80=98guix lint=E2=
=80=99 says.

As for the goal itself, I think sorting is a good idea when there are
lots of inputs (things like IceCat), but otherwise I personally don=E2=80=
=99t
think it matters that much.

What do people think?

Thanks,
Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#33575; Package guix-patches. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 2 Dec 2018 07:42:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Dec 02 02:42:59 2018
Received: from localhost ([127.0.0.1]:57519 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gTMP5-00010k-A7
	for submit <at> debbugs.gnu.org; Sun, 02 Dec 2018 02:42:59 -0500
Received: from eggs.gnu.org ([208.118.235.92]:35058)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <arunisaac@HIDDEN>) id 1gTMP3-00010V-6t
 for submit <at> debbugs.gnu.org; Sun, 02 Dec 2018 02:42:57 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <arunisaac@HIDDEN>) id 1gTMOx-0005Yc-0M
 for submit <at> debbugs.gnu.org; Sun, 02 Dec 2018 02:42:51 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: **
X-Spam-Status: No, score=2.3 required=5.0 tests=BAYES_50,RCVD_IN_SORBS_WEB
 autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:36441)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <arunisaac@HIDDEN>)
 id 1gTMOw-0005YW-Tl
 for submit <at> debbugs.gnu.org; Sun, 02 Dec 2018 02:42:50 -0500
Received: from eggs.gnu.org ([2001:4830:134:3::10]:44663)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <arunisaac@HIDDEN>) id 1gTMOw-0007gj-22
 for guix-patches@HIDDEN; Sun, 02 Dec 2018 02:42:50 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <arunisaac@HIDDEN>) id 1gTMOr-0005Vv-31
 for guix-patches@HIDDEN; Sun, 02 Dec 2018 02:42:49 -0500
Received: from vultr.systemreboot.net ([45.77.148.100]:41124)
 by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <arunisaac@HIDDEN>)
 id 1gTMOq-0005P0-N9
 for guix-patches@HIDDEN; Sun, 02 Dec 2018 02:42:45 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
 d=systemreboot.net; s=default; h=Content-Transfer-Encoding:Content-Type:
 MIME-Version:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID:
 Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc
 :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=apyJcGGF8INHSwazKRwMU7eCFa2XA8z9mL0O+JcBdtY=; b=jy36/dfWi907rjqqF9Je2qV+xS
 8Ia6zi8MxmY9cmyC5cZez7AOTPNAWZCTmrVKNWC4ByGsjQ83f5HD+Qsoiai7Quw4++Pb+qjowH6cZ
 hvtz6nWptXgsIz4zUOunVTHmCwvhzatbFWrwSN04AaLuyhCwtP0NL7nd9DZ4EZHMRFi8=;
Received: from [103.5.134.173] (helo=localhost.localdomain)
 by systemreboot.net with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128)
 (Exim 4.91) (envelope-from <arunisaac@HIDDEN>)
 id 1gTMOl-0003wK-1Z; Sun, 02 Dec 2018 13:12:40 +0530
From: Arun Isaac <arunisaac@HIDDEN>
To: guix-patches@HIDDEN
Subject: [PATCH] guix: lint: Add checker to check if inputs are sorted.
Date: Sun,  2 Dec 2018 13:12:10 +0530
Message-Id: <20181202074210.31361-1-arunisaac@HIDDEN>
X-Mailer: git-send-email 2.19.1
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
 [fuzzy]
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -2.6 (--)
X-Debbugs-Envelope-To: submit
Cc: Arun Isaac <arunisaac@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.6 (---)

* guix/scripts/lint.scm (check-inputs-should-be-sorted): New procedure.
(%checkers): Add it.
---
 guix/scripts/lint.scm | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/guix/scripts/lint.scm b/guix/scripts/lint.scm
index 2314f3b28..37e8a1ec5 100644
--- a/guix/scripts/lint.scm
+++ b/guix/scripts/lint.scm
@@ -8,6 +8,7 @@
 ;;; Copyright © 2017 Alex Kost <alezost@HIDDEN>
 ;;; Copyright © 2017 Tobias Geerinckx-Rice <me@HIDDEN>
 ;;; Copyright © 2017 Efraim Flashner <efraim@HIDDEN>
+;;; Copyright © 2018 Arun Isaac <arunisaac@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -301,6 +302,22 @@ of a package, and INPUT-NAMES, a list of package specifications such as
               (package-input-intersection (package-direct-inputs package)
                                           input-names))))
 
+(define (check-inputs-should-be-sorted package)
+  ;; Emit a warning if inputs, native inputs or propagated inputs of PACKAGE
+  ;; are not lexicographically ordered.
+  (define (check-inputs inputs-accessor input-type)
+    (unless (sorted? (map (match-lambda
+                            ((name input) name))
+                          (inputs-accessor package))
+                     string<?)
+      (emit-warning
+       package
+       (format #f (G_ "~a should be in lexicographic order") input-type))))
+
+  (check-inputs package-inputs (G_ "inputs"))
+  (check-inputs package-native-inputs (G_ "native inputs"))
+  (check-inputs package-propagated-inputs (G_ "propagated inputs")))
+
 (define (package-name-regexp package)
   "Return a regexp that matches PACKAGE's name as a word at the beginning of a
 line."
@@ -1032,6 +1049,10 @@ them for PACKAGE."
      (name        'inputs-should-not-be-input)
      (description "Identify inputs that shouldn't be inputs at all")
      (check       check-inputs-should-not-be-an-input-at-all))
+   (lint-checker
+     (name        'inputs-should-be-sorted)
+     (description "Verify that inputs are in lexicographic order")
+     (check       check-inputs-should-be-sorted))
    (lint-checker
      (name        'patch-file-names)
      (description "Validate file names and availability of patches")
-- 
2.19.1





Acknowledgement sent to Arun Isaac <arunisaac@HIDDEN>:
New bug report received and forwarded. Copy sent to guix-patches@HIDDEN. Full text available.
Report forwarded to guix-patches@HIDDEN:
bug#33575; Package guix-patches. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Thu, 6 Dec 2018 12:30:06 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.