Thread (26 messages) 26 messages, 4 authors, 2025-07-02

Re: [PATCH 1/4] editorconfig: set maximum line length to 120 characters

From: Karthik Nayak <hidden>
Date: 2025-06-27 08:51:17

Justin Tobler [off-list ref] writes:
On 25/06/25 06:43PM, Karthik Nayak wrote:
quoted
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.
Hello Justin,
I frequently use the format operator in vim to reformat entire blocks of
text and it is commonly configured to use `max_line_length` from an
`.editorconfig` file to know when to wrap lines. Changing the value to
120 would cause my editor to prefer 120 character lines when
reformatting, which I would personally not like.
It would only wrap lines longer than 120 columns. Currently editorconfig
doesn't wrap any line length. So we're essentially saying, any line
above 120 is not something we want to accept and hence wrap. This
doesn't mean that shorter lines will be combined together. Wouldn't this
be better than the current situation?
Being that `max_line_length` is only a suggestion for the editor, I
think we may be better off setting it to 80 characters or leaving it
unset entirely.

-Justin
quoted
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

Signed-off-by: Karthik Nayak <redacted>

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help