Subject: [bug#31485] [PATCH] gnu: Add uncrustify.

From: [email-masked] (Ludovic Courtès)
Date: Sat, 19 May 2018 22:32:13 +0200

Hi Pierre,

Pierre Neidhardt <[email-masked]> skribis:

> * gnu/packages/pretty-print.scm (uncrustify): New variable.

Thanks for the patch!  Perhaps indent.scm or code.scm would be a better
match?

> +         (add-after 'unpack 'unpack-etc
> +           (lambda* (#:key inputs outputs #:allow-other-keys)
> +             ;; Configuration samples are not installed by default.
> +             (let* ((output (assoc-ref outputs "out"))
> +                    (etcdir (string-append output "/etc")))
> +               (begin

You can omit ‘begin’.

> +                 (mkdir-p etcdir)
> +                 (for-each (lambda (l)
> +                             (copy-file
> +                              l (string-append etcdir "/" (basename l))))

Simply: (install-file l etcdir), and you can omit ‘mkdir-p’ as well.

> +    (home-page "http://uncrustify.sourceforge.net/")
> +    (synopsis "Source Code Beautifier for C, C++, C#, ObjectiveC, D, Java, Pawn and VALA")

Maybe: “Indent source code written in C or related languages”?
(I wasn’t sure what “beautifier” meant.)

> +    (description
> +     "A highly configurable, easily modifiable source code beautifier.  Features:
> +- Indent code, aligning on parens, assignments, etc.
> +- Align on @code{=} and variable definitions.
> +- Align structure initializers.
> +- Align #define stuff.
> +- Align backslash-newline stuff.
> +- Reformat comments (a little bit).
> +- Fix inter-character spacing.
> +- Add or remove parens on return statements.
> +- Add or remove braces on single-statement if/do/while/for statements.
> +- Supports embedded SQL @code{EXEC SQL} stuff.
> +- Highly configurable - More than 600 configurable options.")

Please use full sentences and Texinfo markup for lists (@enumerate,
etc.):

  https://www.gnu.org/software/guix/manual/html_node/Synopses-and-Descriptions.html

I’m not sure we need to least feature with this level of detail, though.
Your call!

> +    (license gpl2)))

Should be ‘gpl2+’ (version 2 “or any later version”).

Could you send an updated patch?

Thanks,
Ludo’.