bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: Simon Josefsson via Gnulib discussion list <bug-gnulib@gnu.org>
To: Collin Funk <collin.funk1@gmail.com>
Cc: bug-inetutils@gnu.org, bug-gnulib@gnu.org
Subject: Re: Indentation mistake
Date: Fri, 03 May 2024 08:46:30 +0200	[thread overview]
Message-ID: <877cgbv1dl.fsf@kaka.sjd.se> (raw)
In-Reply-To: <7dc6b66a-cecf-4f48-bd7d-325b7296b24b@gmail.com> (Collin Funk's message of "Thu, 2 May 2024 20:51:21 -0700")


[-- Attachment #1.1: Type: text/plain, Size: 1273 bytes --]

Collin Funk <collin.funk1@gmail.com> writes:

> Hi Simon,
>
> On 5/2/24 11:25 AM, Simon Josefsson via Bug reports for the GNU Internet utilities wrote:
>>> Sadly, I cannot do this, at least not easily.  After installing GNU
>>> indent, "make syntax-check" complains about many files:
>>>
>>>     $ indent --version
>>>     GNU indent 2.2.12
>> You need 2.2.13 :-)
>
> I see that you added the 'syntax-check' for indent in Gnulib. One
> minor problem though, it breaks if the user has an ~/.indent.pro. :)
>
> I don't use indent much, so I forgot my repository where I store
> dotfiles installs this:
>
>     $ cat ~/.indent.pro 
>     --gnu-style
>     --no-tabs
>
> Here lets check if the code is indented:
>
>     $ make sc_indent | wc -l
>     maint.mk: code format error, try "make indent"
>     make: *** [maint.mk:1760: sc_indent] Error 1
>     52751
>
> I was confused for a bit until I saw that file.
>
>    $ rm ~/.indent.pro
>    $ make sc_indent | wc -l
>    1
>
> Indent has -npro that you can use to ignore the file which might be
> good.

Nice catch.  It doesn't make sense for maint.mk's indentation to be
influenced by ~/.indent.pro -- the style has to be a per-project
setting.  I pushed the patch below.

/Simon

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-maint.mk-Don-t-fail-on-.indent.pro-reported-by-Colli.patch --]
[-- Type: text/x-diff, Size: 1264 bytes --]

From 6213c5bd72d15ca5e1ea9c34122899e02fed448c Mon Sep 17 00:00:00 2001
From: Simon Josefsson <simon@josefsson.org>
Date: Fri, 3 May 2024 08:44:03 +0200
Subject: [PATCH] maint.mk: Don't fail on ~/.indent.pro, reported by Collin
 Funk.

* top/maint.mk (indent_args): Use --ignore-profile.
---
 ChangeLog    | 5 +++++
 top/maint.mk | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index d967c8cfac..2781a70800 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2024-05-03  Simon Josefsson  <simon@josefsson.org>
+
+	maint.mk: Don't fail on ~/.indent.pro, reported by Collin Funk.
+	* top/maint.mk (indent_args): Use --ignore-profile.
+
 2024-05-02  Collin Funk  <collin.funk1@gmail.com>
 
 	gnulib-tool.sh: Fix program name in error message.
diff --git a/top/maint.mk b/top/maint.mk
index c30e71ba6e..af865717c4 100644
--- a/top/maint.mk
+++ b/top/maint.mk
@@ -1746,7 +1746,7 @@ refresh-po:
 
 # Indentation
 
-indent_args ?= -ppi 1
+indent_args ?= --ignore-profile --preprocessor-indentation 1
 C_SOURCES ?= $$($(VC_LIST_EXCEPT) | grep '\.[ch]\(.in\)\?$$')
 INDENT_SOURCES ?= $(C_SOURCES)
 exclude_file_name_regexp--indent ?= $(exclude_file_name_regexp--sc_indent)
-- 
2.34.1


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 255 bytes --]

       reply	other threads:[~2024-05-03  6:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <97b1fabf-bbd1-4d36-95c3-bd7aaeceedf4@gmail.com>
     [not found] ` <87frv0umic.fsf@kaka.sjd.se>
     [not found]   ` <20240502180503.GB15513@unix-ag.uni-kl.de>
     [not found]     ` <2a77f003d6b0f2cd4e247bc3d3245089782b6bb4.camel@josefsson.org>
     [not found]       ` <20240502182013.GC15513@unix-ag.uni-kl.de>
     [not found]         ` <87bk5oul4b.fsf@kaka.sjd.se>
     [not found]           ` <7dc6b66a-cecf-4f48-bd7d-325b7296b24b@gmail.com>
2024-05-03  6:46             ` Simon Josefsson via Gnulib discussion list [this message]
2024-05-03 21:22               ` Indentation mistake Collin Funk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877cgbv1dl.fsf@kaka.sjd.se \
    --to=bug-gnulib@gnu.org \
    --cc=bug-inetutils@gnu.org \
    --cc=collin.funk1@gmail.com \
    --cc=simon@josefsson.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).