GNU bug report logs - #37300
Imported packages' indentation doesn't respect Guix conventions

Previous Next

Package: guix;

Reported by: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Date: Wed, 4 Sep 2019 03:18:01 UTC

Severity: normal

Done: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: bug#37300: closed (Re: bug#37300: Imported packages' indentation
 doesn't respect Guix conventions)
Date: Thu, 20 Jul 2023 13:24:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#37300: Imported packages' indentation doesn't respect Guix conventions

which was filed against the guix package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 37300 <at> debbugs.gnu.org.

-- 
37300: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=37300
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: 37300-done <at> debbugs.gnu.org
Subject: Re: bug#37300: Imported packages' indentation doesn't respect Guix
 conventions
Date: Thu, 20 Jul 2023 09:23:28 -0400
Hello,

Maxim Cournoyer <maxim.cournoyer <at> gmail.com> writes:

> The package definitions imported by Guix importers do not respect Guix
> conventions regarding indentation.
>
> Consider:
>
> guix pypi import transaction
>
> (package
>   (name "python-transaction")
>   (version "2.4.0")
>   (source
>     (origin
>       (method url-fetch)
>       (uri (pypi-uri "transaction" version))
>       (sha256
>         (base32
>           "17wz1y524ca07vr03yddy8dv0gbscs06dbdywmllxv5rc725jq3j"))))
>   (build-system python-build-system)
>   (propagated-inputs
>     `(("python-zope.interface" ,python-zope.interface)))
>   (native-inputs
>     `(("python-coverage" ,python-coverage)
>       ("python-mock" ,python-mock)
>       ("python-nose" ,python-nose)))
>   (home-page
>     "https://github.com/zopefoundation/transaction")
>   (synopsis "Transaction management for Python")
>   (description "Transaction management for Python")
>   (license #f))
>
> Re-identing this in Emacs with the Guix .dir-local.el indentation
> customizations yields:
>
> (define-public python-transaction
>   (package
>     (name "python-transaction")
>     (version "2.4.0")
>     (source
>      (origin
>        (method url-fetch)
>        (uri (pypi-uri "transaction" version))
>        (sha256
>         (base32
>          "17wz1y524ca07vr03yddy8dv0gbscs06dbdywmllxv5rc725jq3j"))))
>     (build-system python-build-system)
>     (propagated-inputs
>      `(("python-zope.interface" ,python-zope.interface)))
>     (native-inputs
>      `(("python-coverage" ,python-coverage)
>        ("python-mock" ,python-mock)
>        ("python-nose" ,python-nose)))
>     (home-page
>      "https://github.com/zopefoundation/transaction")
>     (synopsis "Transaction management for Python")
>     (description "Transaction management for Python")
>     (license #f)))

That's been taken care of by applying 'guix style' to the
importer-generated definitions; it now looks like:

(define-public python-transaction
  (package
    (name "python-transaction")
    (version "3.1.0")
    (source (origin
              (method url-fetch)
              (uri (pypi-uri "transaction" version))
              (sha256
               (base32
                "191gj6pzvgw0726dsywy8pbj7shxnkc6pyrpnbiw9ryvjbmb3l35"))))
    (build-system pyproject-build-system)
    (propagated-inputs (list python-zope.interface))
    (native-inputs (list python-coverage python-mock python-nose))
    (home-page "https://github.com/zopefoundation/transaction")
    (synopsis "Transaction management for Python")
    (description "Transaction management for Python")
    (license #f)))

which is correct.

Closing.

-- 
Thanks,
Maxim

[Message part 3 (message/rfc822, inline)]
From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: bug-guix <bug-guix <at> gnu.org>
Subject: Imported packages' indentation doesn't respect Guix conventions
Date: Wed, 04 Sep 2019 12:17:10 +0900
The package definitions imported by Guix importers do not respect Guix
conventions regarding indentation.

Consider:

guix pypi import transaction

(package
  (name "python-transaction")
  (version "2.4.0")
  (source
    (origin
      (method url-fetch)
      (uri (pypi-uri "transaction" version))
      (sha256
        (base32
          "17wz1y524ca07vr03yddy8dv0gbscs06dbdywmllxv5rc725jq3j"))))
  (build-system python-build-system)
  (propagated-inputs
    `(("python-zope.interface" ,python-zope.interface)))
  (native-inputs
    `(("python-coverage" ,python-coverage)
      ("python-mock" ,python-mock)
      ("python-nose" ,python-nose)))
  (home-page
    "https://github.com/zopefoundation/transaction")
  (synopsis "Transaction management for Python")
  (description "Transaction management for Python")
  (license #f))

Re-identing this in Emacs with the Guix .dir-local.el indentation
customizations yields:

(define-public python-transaction
  (package
    (name "python-transaction")
    (version "2.4.0")
    (source
     (origin
       (method url-fetch)
       (uri (pypi-uri "transaction" version))
       (sha256
        (base32
         "17wz1y524ca07vr03yddy8dv0gbscs06dbdywmllxv5rc725jq3j"))))
    (build-system python-build-system)
    (propagated-inputs
     `(("python-zope.interface" ,python-zope.interface)))
    (native-inputs
     `(("python-coverage" ,python-coverage)
       ("python-mock" ,python-mock)
       ("python-nose" ,python-nose)))
    (home-page
     "https://github.com/zopefoundation/transaction")
    (synopsis "Transaction management for Python")
    (description "Transaction management for Python")
    (license #f)))

Multiple record fields indentation offset is set to 1 instead of the
regular 2.

This is produced by the function pretty-print from ice-9. Maybe there's
a way to configure the indentation rules used by pretty-print?



This bug report was last modified 1 year and 362 days ago.

Previous Next


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