Subject: [bug#60910] [PATCH 12/25] gnu: Add xurls.

From: Katherine Cox-Buday <[email-masked]>
Date: Tue, 07 Feb 2023 10:51:14 -0700

"( via Guix-patches" via <[email-masked]> writes:

> * gnu/packages/golang.scm (xurls): New variable.
>
>> --- a/gnu/packages/golang.scm
>> +++ b/gnu/packages/golang.scm
>
>> @@ -9760,6 +9760,38 @@ (define-public go-go-uber-org-multierr
>
>> +    (arguments
>> +     `(#:import-path "mvdan.cc/xurls/v2"
>> +       #:unpack-path "mvdan.cc/xurls/v2"
>> +       #:phases (modify-phases %standard-phases
>> +                  (replace 'build
>> +                    (lambda arguments
>> +                      (apply (assoc-ref %standard-phases
>> +                                        'build)
>> +                             `(,@arguments #:import-path
>> +                               "mvdan.cc/xurls/v2/cmd/xurls")))))))
>
> I'm not certain what you're trying to accomplish here, but would you be able
> to replace this with:
>
>   (arguments
>    `(#:import-path "mvdan.cc/xurls/v2"
>      #:unpack-path "mvdan.cc/xurls/v2/cmd/xurls"))
>
> ?

Hm, I'm sure I would have tried that, but I'll check and see if I can
condense this per your suggestion. Thanks!

>> +    (inputs (list go-golang-org-x-sync go-github-com-rogpeppe-go-internal))
>
> Add newlines after the ``inputs'' symbol and between the inputs :)

Why wouldn't `guix style` and `guix lint` correct this? I want to meet
the style guidelines, and I don't mean this as a contrarian statement,
but I'll never get this right unless a tool tells me it's wrong (or
ideally fixes it for me).

>> +    (description
>> +     "Xurls extracts urls from plain text using regular expressions.  It can
>> +be used as both a binary and a library.")
>
> s/Xurls extracts/This package provides a Go library for extracting/

https://guix.gnu.org/en/manual/devel/en/guix.html#Synopses-and-Descriptions:

    [Synopses] must not start with “a” or “the”, which usually does not
    bring anything; for instance, prefer “File-frobbing tool” over “A
    tool that frobs files”. The synopsis should say what the package
    is—e.g., “Core GNU utilities (file, text, shell)”—or what it is used
    for—e.g., the synopsis for GNU grep is “Print lines matching a
    pattern”.

The manual is speaking of synopses, but does it apply to descriptions
too? It seems to me like beginning the description with the name of the
binary is more correct than a self-referential "This package", which I
think meets the manual's qualifier for "does not bring anything".

Also, `Xurls` is both a library and an executable. This package is for
the executable, and a separate one was provided for the library. I think
it's probably better to keep it in the style of "$BINARY (thing that it
does)".

WDYT? These are just my opinions, and I'm open to learning! Please
include the "why" so I can have better judgment in the future.

-- 
Katherine