From: Junio C Hamano <gitster@pobox•com>
To: Karthik Nayak <karthik.188@gmail•com>
Cc: git@vger•kernel.org, Christian Couder <chriscool@tuxfamily•org>
Subject: Re: [PATCH 1/4] editorconfig: set maximum line length to 120 characters
Date: Wed, 25 Jun 2025 11:41:47 -0700 [thread overview]
Message-ID: <xmqqo6ubu0ic.fsf@gitster.g> (raw)
In-Reply-To: <20250625-525-make-clang-format-more-robust-v1-1-67a49ecc2fd5@gmail.com> (Karthik Nayak's message of "Wed, 25 Jun 2025 18:43:26 +0200")
Karthik Nayak <karthik.188@gmail•com> writes:
> As per 'Documentation/CodingGuidelines', we try to keep to at most 80
> characters per line. However, there are often certain cases where we
> extend this for the sake of readability.
>
> Add a maximum limit of 120 characters to the '.editorconfig'. This means
> that if an individual line exceeds 120 characters, the editor will wrap
> that line. This provides a lot wiggle room over the recommended 80
> character limit.
Ideally "when the line is overly long to be more than 120 columns,
please wrap it to 80 columns or less" is what we want. If the
result of formatting a single 125 column line leaves us with two
lines, one with 100 columns and another with 25 columns, this would
not be very useful. As this is meant to give suggestions without
enforcing hard rule, wouldn't it make more sense to set it to 80?
I dunno.
> Contrary to settings within '.clang-format' which are used for
> statically formatting source code, the '.editorconfig' rules are hints
> to the editor. These are not enforced by CI and are guidelines for
> editors to follow. As such, the 'max_line_length' used here is only
> supported in a set of editors [1].
>
> [1]: https://github.com/editorconfig/editorconfig/wiki/EditorConfig-Properties#max_line_length
Thanks.
The discussion around "rulers" https://github.com/editorconfig/editorconfig/issues/89
was also interesting.
> Signed-off-by: Karthik Nayak <karthik.188@gmail•com>
> ---
> .editorconfig | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/.editorconfig b/.editorconfig
> index 2d3929b591..d0f940fd23 100644
> --- a/.editorconfig
> +++ b/.editorconfig
> @@ -7,6 +7,7 @@ insert_final_newline = true
> [{*.{c,h,sh,bash,perl,pl,pm,txt,adoc},config.mak.*,Makefile}]
> indent_style = tab
> tab_width = 8
> +max_line_length = 120
>
> [*.py]
> indent_style = space
next prev parent reply other threads:[~2025-06-25 18:41 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-25 16:43 [PATCH 0/4] clang-format: modify rules to reduce false-positives Karthik Nayak
2025-06-25 16:43 ` [PATCH 1/4] editorconfig: set maximum line length to 120 characters Karthik Nayak
2025-06-25 18:41 ` Junio C Hamano [this message]
2025-06-26 8:27 ` Karthik Nayak
2025-06-26 14:25 ` Junio C Hamano
2025-06-27 8:38 ` Karthik Nayak
2025-06-26 16:22 ` Justin Tobler
2025-06-27 8:51 ` Karthik Nayak
2025-06-27 15:12 ` Justin Tobler
2025-06-30 8:29 ` Karthik Nayak
2025-06-25 16:43 ` [PATCH 2/4] clang-format: set 'ColumnLimit' to 0 Karthik Nayak
2025-06-25 16:43 ` [PATCH 3/4] clang-format: add 'RemoveBracesLLVM' to the main config Karthik Nayak
2025-06-25 16:43 ` [PATCH 4/4] meson: add rule to run 'git clang-format' Karthik Nayak
2025-06-26 16:35 ` Justin Tobler
2025-06-27 8:12 ` Karthik Nayak
2025-06-27 14:25 ` Junio C Hamano
2025-06-30 8:34 ` Karthik Nayak
2025-06-30 15:24 ` Junio C Hamano
2025-06-30 8:38 ` [PATCH v2 0/3] clang-format: modify rules to reduce false-positives Karthik Nayak
2025-06-30 8:38 ` [PATCH v2 1/3] clang-format: set 'ColumnLimit' to 0 Karthik Nayak
2025-06-30 8:38 ` [PATCH v2 2/3] clang-format: add 'RemoveBracesLLVM' to the main config Karthik Nayak
2025-06-30 8:38 ` [PATCH v2 3/3] meson: add rule to run 'git clang-format' Karthik Nayak
2025-07-01 10:13 ` Patrick Steinhardt
2025-07-01 15:08 ` Karthik Nayak
2025-07-01 16:02 ` Junio C Hamano
2025-07-01 13:26 ` Toon Claes
2025-07-01 15:12 ` Karthik Nayak
2025-07-02 2:54 ` Patrick Steinhardt
2025-06-30 15:27 ` [PATCH v2 0/3] clang-format: modify rules to reduce false-positives Junio C Hamano
2025-07-01 13:36 ` Toon Claes
2025-07-01 15:19 ` Karthik Nayak
2025-07-01 20:49 ` Junio C Hamano
2025-07-02 9:23 ` [PATCH v3 " Karthik Nayak
2025-07-02 9:23 ` [PATCH v3 1/3] clang-format: set 'ColumnLimit' to 0 Karthik Nayak
2025-07-02 9:23 ` [PATCH v3 2/3] clang-format: add 'RemoveBracesLLVM' to the main config Karthik Nayak
2025-07-02 9:23 ` [PATCH v3 3/3] meson: add rule to run 'git clang-format' Karthik Nayak
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=xmqqo6ubu0ic.fsf@gitster.g \
--to=gitster@pobox$(echo .)com \
--cc=chriscool@tuxfamily$(echo .)org \
--cc=git@vger$(echo .)kernel.org \
--cc=karthik.188@gmail$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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