unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: Cyril Roelandt <tipecaml@gmail.com>
Cc: guix-devel@gnu.org
Subject: Re: [PATCH] scripts: add guix lint
Date: Tue, 26 Aug 2014 00:44:18 +0200	[thread overview]
Message-ID: <87egw4gpfh.fsf@gnu.org> (raw)
In-Reply-To: <1408931564-3992-1-git-send-email-tipecaml@gmail.com> (Cyril Roelandt's message of "Mon, 25 Aug 2014 03:52:44 +0200")

Cyril Roelandt <tipecaml@gmail.com> skribis:

> * guix/scripts/lint.scm: New file. Defines a 'lint' tool for Guix packages.
> * tests/lint.scm: New file.
> * Makefile.am (MODULES, SCM_TESTS): Add them.
> * guix/scripts/build.scm (specification->package): Move from here...
> * guix/ui.scm: ... to here.
> * po/guix/Makevars: Update appropriately.
> * po/guix/POTFILES.in: Update appropriately.
> * doc/guix.texi: Document "guix lint".

Cool!

> --- a/doc/guix.texi
> +++ b/doc/guix.texi
> @@ -1459,6 +1459,10 @@ package may actually be built using the @code{guix build} command-line
>  tool (@pxref{Invoking guix build}).  @xref{Packaging Guidelines}, for
>  more information on how to test package definitions.
>  
> +In order to catch common errors and stylistic issues, the packages might
> +actually be checked by running the @command{guix lint} command
> +(@pxref{Invoking guix lint}).

What about just making it like this:

  [...] @xref{Packaging Guidelines}, for more information on how to test
  package definitions, and @ref{Invoking guix lint}, for information
  on how to check a definition for style conformance.

>  Eventually, updating the package definition to a new upstream version
>  can be partly automated by the @command{guix refresh} command
>  (@pxref{Invoking guix refresh}).
> @@ -2326,6 +2330,7 @@ programming interface of Guix in a convenient way.
>  * Invoking guix download::      Downloading a file and printing its hash.
>  * Invoking guix hash::          Computing the cryptographic hash of a file.
>  * Invoking guix refresh::       Updating package definitions.
> +* Invoking guix lint::          Finding errors in package definitions.
>  @end menu
>  
>  @node Invoking guix build
> @@ -2703,6 +2708,28 @@ for in @code{$PATH}.
>  
>  @end table
>  
> +@node Invoking guix lint
> +@section Invoking @command{guix lint}
> +The @command{guix lint} command runs a few checks on a given set of
> +packages in order to find common mistakes in their definitions.

To make the target audience clearer, what about this:

  The @command{guix lint} is meant to help package developers avoid
  common errors and use a consistent style.  It runs a series of checks
  on the given set of packages [...]

> -(define (specification->package spec)
> -  "Return a package matching SPEC.  SPEC may be a package name, or a package
> -name followed by a hyphen and a version number.  If the version number is not
> -present, return the preferred newest version."
> -  (let-values (((name version)
> -                (package-name->name+version spec)))
> -    (match (find-best-packages-by-name name version)

Apologies for giving incorrect advice in my previous review; could you
move this procedure to (gnu packages) (and not (guix ui), as I
wrongfully suggested)?  Ideally in a separate commit.

The reason is to avoid introducing a dependency from (guix ui) to (gnu
packages).

OK to commit with these minor issues fixed.

Thanks!

Ludo’.

  reply	other threads:[~2014-08-25 22:44 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-21 23:51 [PATCH 0/2] Add "guix lint" Cyril Roelandt
2014-07-21 23:51 ` [PATCH 1/2] scripts: add guix lint Cyril Roelandt
2014-07-22  9:03   ` Ludovic Courtès
2014-07-22 13:38     ` Ludovic Courtès
2014-07-22 14:31     ` Eric Bavier
2014-07-22 15:26       ` Ludovic Courtès
2014-08-25  1:52     ` [PATCH] " Cyril Roelandt
2014-08-25 22:44       ` Ludovic Courtès [this message]
2014-09-01  0:39         ` [PATCH 1/2] Move specification->package to gnu/packages.scm Cyril Roelandt
2014-09-01  0:39           ` [PATCH 2/2] scripts: add guix lint Cyril Roelandt
2014-09-01 21:19             ` Ludovic Courtès
2014-09-01  8:55           ` [PATCH 1/2] Move specification->package to gnu/packages.scm Ludovic Courtès
2014-07-21 23:51 ` [PATCH 2/2] gnu/packages: Remove trailing periods in some synopses Cyril Roelandt
2014-07-22 19:27 ` [PATCH 0/2] Add "guix lint" Andreas Enge
2014-07-22 20:25   ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87egw4gpfh.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=guix-devel@gnu.org \
    --cc=tipecaml@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).