unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#37300: Imported packages' indentation doesn't respect Guix conventions
@ 2019-09-04  3:17 Maxim Cournoyer
  2023-07-20 13:23 ` Maxim Cournoyer
  0 siblings, 1 reply; 2+ messages in thread
From: Maxim Cournoyer @ 2019-09-04  3:17 UTC (permalink / raw)
  To: 37300

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?

^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#37300: Imported packages' indentation doesn't respect Guix conventions
  2019-09-04  3:17 bug#37300: Imported packages' indentation doesn't respect Guix conventions Maxim Cournoyer
@ 2023-07-20 13:23 ` Maxim Cournoyer
  0 siblings, 0 replies; 2+ messages in thread
From: Maxim Cournoyer @ 2023-07-20 13:23 UTC (permalink / raw)
  To: 37300-done

Hello,

Maxim Cournoyer <maxim.cournoyer@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




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-07-20 13:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-04  3:17 bug#37300: Imported packages' indentation doesn't respect Guix conventions Maxim Cournoyer
2023-07-20 13:23 ` Maxim Cournoyer

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).