GNU bug report logs - #62000
Inconsistent indentation rules for define-configuration

Previous Next

Package: guix;

Reported by: Bruno Victal <mirai <at> makinata.eu>

Date: Mon, 6 Mar 2023 12:50:01 UTC

Severity: normal

Done: Bruno Victal <mirai <at> makinata.eu>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 62000 in the body.
You can then email your comments to 62000 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#62000; Package guix. (Mon, 06 Mar 2023 12:50:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Bruno Victal <mirai <at> makinata.eu>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Mon, 06 Mar 2023 12:50:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Bruno Victal <mirai <at> makinata.eu>
To: bug-guix <bug-guix <at> gnu.org>
Subject: Inconsistent indentation rules for define-configuration
Date: Mon, 6 Mar 2023 12:48:56 +0000
Suspected file: .dir-locals.el


Using 'package' as a field in define-configuration results in inconsistent indentation:

--8<---------------cut here---------------start------------->8---
(define-configuration/no-serialization mympd-configuration
  (package
    (file-like mympd)        ;;;; <<<<<<<<<<<<<<<<<<<<< notice how it's indented with 2 spaces
    "The package object of the myMPD server."
    empty-serializer)

  (shepherd-requirement
   (list-of-symbol '())      ;;;; <<<<<<<<<<<<<<<<<<<<< vs 1 space
   "This is a list of symbols naming Shepherd services that this service
will depend on."
   empty-serializer)

;; ...
)
--8<---------------cut here---------------end--------------->8---




Information forwarded to bug-guix <at> gnu.org:
bug#62000; Package guix. (Tue, 07 Mar 2023 13:49:03 GMT) Full text and rfc822 format available.

Message #8 received at 62000 <at> debbugs.gnu.org (full text, mbox):

From: Simon Tournier <zimon.toutoune <at> gmail.com>
To: Bruno Victal <mirai <at> makinata.eu>, 62000 <at> debbugs.gnu.org
Subject: Re: bug#62000: Inconsistent indentation rules for define-configuration
Date: Tue, 07 Mar 2023 14:16:57 +0100
Hi,

Cool you had the number 62000. ;-)

On Mon, 06 Mar 2023 at 12:48, Bruno Victal <mirai <at> makinata.eu> wrote:
> Suspected file: .dir-locals.el
>
> Using 'package' as a field in define-configuration results in
> inconsistent indentation: 
>
> --8<---------------cut here---------------start------------->8---
> (define-configuration/no-serialization mympd-configuration
>   (package
>     (file-like mympd)        ;;;; <<<<<<<<<<<<<<<<<<<<< notice how it's indented with 2 spaces
>     "The package object of the myMPD server."
>     empty-serializer)
>
>   (shepherd-requirement
>    (list-of-symbol '())      ;;;; <<<<<<<<<<<<<<<<<<<<< vs 1 space
>    "This is a list of symbols naming Shepherd services that this service
> will depend on."
>    empty-serializer)
>
> ;; ...
> )
> --8<---------------cut here---------------end--------------->8---

What do you mean by inconsistent?  Do you think that
’sheperd-requirement’ should be management by .dir-locals.el?

Well, .dirl-locals.el does not consider the context, IIUC.

For instance,

        (let ((package something))
          (package
            ()
            )
          )

Because of .dir-locals.el, the rules looks like that:

        (not-in-dir-locals.el
         ()
         )

        (package
          ()
          )

        (package/inherit
            ()
          ()
          )

        (add-before
            ()
            ()
          ()
          )

        (let-keywords
            ()
            ()
            ()
          ()
          )

Or you can see that differently,

        (not-in-dir-locals.el ()
                              ()
                              )

        (package ()
                 ()
                 )

        (package/inherit ()
          ()
          )

        (add-before () ()
          ()
          )


Well, since ’sheperd-requirement’ is not in .dir-locals.el, the
indentation seems expected.  What do you consider as a bug?

Cheer,
simon





Information forwarded to bug-guix <at> gnu.org:
bug#62000; Package guix. (Tue, 07 Mar 2023 13:55:02 GMT) Full text and rfc822 format available.

Message #11 received at 62000 <at> debbugs.gnu.org (full text, mbox):

From: Bruno Victal <mirai <at> makinata.eu>
To: Simon Tournier <zimon.toutoune <at> gmail.com>
Cc: 62000 <at> debbugs.gnu.org
Subject: Re: bug#62000: Inconsistent indentation rules for define-configuration
Date: Tue, 7 Mar 2023 13:54:41 +0000
Hi Simon,

On 2023-03-07 13:16, Simon Tournier wrote:
> Hi,
> 
> Cool you had the number 62000. ;-)
> 
> On Mon, 06 Mar 2023 at 12:48, Bruno Victal <mirai <at> makinata.eu> wrote:
>> Suspected file: .dir-locals.el
>>
>> Using 'package' as a field in define-configuration results in
>> inconsistent indentation: 
>>
>> --8<---------------cut here---------------start------------->8---
>> (define-configuration/no-serialization mympd-configuration
>>   (package
>>     (file-like mympd)        ;;;; <<<<<<<<<<<<<<<<<<<<< notice how it's indented with 2 spaces
>>     "The package object of the myMPD server."
>>     empty-serializer)
>>
>>   (shepherd-requirement
>>    (list-of-symbol '())      ;;;; <<<<<<<<<<<<<<<<<<<<< vs 1 space
>>    "This is a list of symbols naming Shepherd services that this service
>> will depend on."
>>    empty-serializer)
>>
>> ;; ...
>> )
>> --8<---------------cut here---------------end--------------->8---
> 
> What do you mean by inconsistent?  Do you think that
> ’sheperd-requirement’ should be management by .dir-locals.el?

It's not 'shepherd-requirement' that should be managed by .dir-locals.el, it could have been named something else.

Compare with 'mympd-ip-acl':

--8<---------------cut here---------------start------------->8---
(define-configuration/no-serialization mympd-ip-acl
  (allow
   (list-of-string '())
   "Allowed IP addresses.")

  (deny
   (list-of-string '())
   "Disallowed IP addresses."))
--8<---------------cut here---------------end--------------->8---

It's uniformly indented.

> Well, since ’sheperd-requirement’ is not in .dir-locals.el, the
> indentation seems expected.  What do you consider as a bug?

Having a field named 'package' within define-configuration causes incorrect indentation.


Cheers,
Bruno.




Information forwarded to bug-guix <at> gnu.org:
bug#62000; Package guix. (Tue, 07 Mar 2023 14:04:02 GMT) Full text and rfc822 format available.

Message #14 received at 62000 <at> debbugs.gnu.org (full text, mbox):

From: Simon Tournier <zimon.toutoune <at> gmail.com>
To: Bruno Victal <mirai <at> makinata.eu>
Cc: 62000 <at> debbugs.gnu.org
Subject: Re: bug#62000: Inconsistent indentation rules for define-configuration
Date: Tue, 7 Mar 2023 15:02:57 +0100
Hi Bruno,

On Tue, 7 Mar 2023 at 14:54, Bruno Victal <mirai <at> makinata.eu> wrote:

> Having a field named 'package' within define-configuration causes incorrect indentation.

As I tried to explain, .dir-locals.el does not consider the context
but only the keyword 'package'.  Because of

   (eval . (put 'package 'scheme-indent-function 0))

each time the word 'package' appears, then it applies the rule.  Maybe
I am missing something but from my point of view, it would not be
possible to change what you are suggesting: apply indentation rules
depending on the context.

Cheers,
simon




Reply sent to Bruno Victal <mirai <at> makinata.eu>:
You have taken responsibility. (Thu, 22 Jun 2023 13:41:02 GMT) Full text and rfc822 format available.

Notification sent to Bruno Victal <mirai <at> makinata.eu>:
bug acknowledged by developer. (Thu, 22 Jun 2023 13:41:02 GMT) Full text and rfc822 format available.

Message #19 received at 62000-done <at> debbugs.gnu.org (full text, mbox):

From: Bruno Victal <mirai <at> makinata.eu>
To: 62000-done <at> debbugs.gnu.org
Cc: zimoun <zimon.toutoune <at> gmail.com>
Subject: Re: Inconsistent indentation rules for define-configuration
Date: Thu, 22 Jun 2023 14:40:00 +0100
Hi Simon,

On 2023-03-07 14:02, Simon Tournier wrote:
> I am missing something but from my point of view, it would not be
> possible to change what you are suggesting: apply indentation rules
> depending on the context
Thanks for the explanation, am closing this then.


-- 
Furthermore, I consider that nonfree software must be eradicated.

Cheers,
Bruno.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 21 Jul 2023 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 279 days ago.

Previous Next


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