From: Junio C Hamano <gitster@pobox.com>
To: Max Gautier <mg@max.gautier.name>
Cc: git@vger.kernel.org, Hans Jerry Illikainen <hji@dyntopia.com>
Subject: Re: [PATCH] editorconfig: add Makefiles to "text files"
Date: Fri, 22 Mar 2024 15:40:59 -0700 [thread overview]
Message-ID: <xmqqo7b5zy84.fsf@gitster.g> (raw)
In-Reply-To: <20240322221813.13019-1-mg@max.gautier.name> (Max Gautier's message of "Fri, 22 Mar 2024 23:17:58 +0100")
Max Gautier <mg@max.gautier.name> writes:
> The Makefile and makefile fragments use the same indent style than the
> rest of the code (with some inconsistencies).
>
> Add them to the relevant .editorconfig section to make life easier for
> editors and reviewers.
>
> Signed-off-by: Max Gautier <mg@max.gautier.name>
> ---
> .editorconfig | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/.editorconfig b/.editorconfig
> index f9d819623d..15d6cbeab1 100644
> --- a/.editorconfig
> +++ b/.editorconfig
> @@ -4,7 +4,7 @@ insert_final_newline = true
>
> # The settings for C (*.c and *.h) files are mirrored in .clang-format. Keep
> # them in sync.
> -[*.{c,h,sh,perl,pl,pm,txt}]
> +[{*.{c,h,sh,perl,pl,pm,txt},config.mak.*,Makefile}]
> indent_style = tab
> tab_width = 8
A question out of curiosity (because the answer does not affect any
conclusion): Does editorconfig attempt to cover any non-text files?
Two more questions that do affect the conclusions are:
* Among the files we ship (i.e. "git ls-tree -r HEAD") and edit
with editors that honor .editorconfig settings, are there any
file that we do not want tab indentation other than *.py?
* Does .editorconfig file allow possibly conflicting setting, with
a reliable conflict resolution rules?
What I am trying to get at is if it is possible to make something
along this line to work:
[*]
charset = utf-8
insert_final_newline = true
indent_style = tab
tab_width = 8
[*.py]
indent_style = space
indet_size = 4
I am assuming, without knowing, that the conflict resolution rule
may be "for the same setting, the last match wins" so by default we
always use "indent_style = tab", but if we are talking about a Python
script, it is overruled with "indent_style = space".
If that is possible, we do not have to keep adding "ah, files that
match this pattern are also text", i.e., everything is text and
indented by tab, unless specified otherwise.
Thanks.
next prev parent reply other threads:[~2024-03-22 22:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-22 22:17 [PATCH] editorconfig: add Makefiles to "text files" Max Gautier
2024-03-22 22:40 ` Junio C Hamano [this message]
2024-03-23 15:55 ` Max Gautier
2024-03-23 17:36 ` Junio C Hamano
2024-03-24 7:54 ` Max Gautier
2024-03-25 2:54 ` Junio C Hamano
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqo7b5zy84.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=hji@dyntopia.com \
--cc=mg@max.gautier.name \
/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 NNTP newsgroup(s).