guix-devel
[Top][All Lists]
Advanced

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

Recommend order for package fields?


From: zimoun
Subject: Recommend order for package fields?
Date: Mon, 15 Nov 2021 17:45:12 +0100

Hi,

On Sun, 07 Nov 2021 at 13:40, Tobias Geerinckx-Rice via Guix-patches via 
<guix-patches@gnu.org> wrote:

> So the de-facto ordering of common fields is something like:
>
> name
> version
> source
> build-system
> outputs ; a bit inconsistent, yes, and sometimes put after *inputs
> arguments ; to the build-system
> native-inputs, inputs, propagated-inputs
> metadata: synopsis, description, home-page, properties, license…
>
> There's some minor variation in where to put inputs, but 
> (build-system trivial-build-system) definitely belongs here, above 
> arguments, no matter what.

Does it make sense to add this ordering advice in the manual?  Somewhere
under section “Contributing”.

Especially when there is probably some issues with the semantic, for
instance, compare [1] corner cases:

--8<---------------cut here---------------start------------->8---
$ guix repl
GNU Guile 3.0.7
Copyright (C) 1995-2021 Free Software Foundation, Inc.

Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
This program is free software, and you are welcome to redistribute it
under certain conditions; type `,show c' for details.

Enter `,help' for help.
scheme@(guix-user)> (let ((name "OUTER"))
  (package-version
   (package
     (version name)
     (name "name")
     (source #f)
     (build-system #f)
     (synopsis #f)
     (description #f)
     (license #f)
     (home-page #f))))

$1 = "OUTER"
scheme@(guix-user)> (let ((name "OUTER"))
  (package-version
   (package
     (name "INNER")
     (version name)
     (source #f)
     (build-system #f)
     (synopsis #f)
     (description #f)
     (license #f)
     (home-page #f))))
$2 = "INNER"
--8<---------------cut here---------------end--------------->8---

where a record field refers to another defined record field.


If yes, why not add a checker for “guix lint” for warning that?  And
obviously, it could be nice to have an automatic tool for formatting;
something similar as etc/indent-code.el for ordering packages. ;-)

Cheers,
simon


1: <https://yhetil.org/guix/20201204161257.64363a5a@scratchpost.org/>



reply via email to

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