* [PATCH] .editorconfig: set max line at 70 chars for QAPI files @ 2023-03-07 12:30 marcandre.lureau 2023-03-07 12:40 ` Daniel P. Berrangé 2023-03-21 7:30 ` Marc-André Lureau 0 siblings, 2 replies; 6+ messages in thread From: marcandre.lureau @ 2023-03-07 12:30 UTC (permalink / raw) To: qemu-devel; +Cc: armbru, Marc-André Lureau From: Marc-André Lureau <marcandre.lureau@redhat.com> This seems to be the preferred style. The EditorConfig property is not supported by all editors: https://github.com/editorconfig/editorconfig/wiki/EditorConfig-Properties#max_line_length Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> --- .editorconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/.editorconfig b/.editorconfig index 7303759ed7..8c5ebc6a1b 100644 --- a/.editorconfig +++ b/.editorconfig @@ -47,3 +47,4 @@ emacs_mode = glsl [*.json] indent_style = space emacs_mode = python +max_line_length = 70 -- 2.39.2 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] .editorconfig: set max line at 70 chars for QAPI files 2023-03-07 12:30 [PATCH] .editorconfig: set max line at 70 chars for QAPI files marcandre.lureau @ 2023-03-07 12:40 ` Daniel P. Berrangé 2023-03-07 12:55 ` Marc-André Lureau 2023-03-07 13:09 ` Markus Armbruster 2023-03-21 7:30 ` Marc-André Lureau 1 sibling, 2 replies; 6+ messages in thread From: Daniel P. Berrangé @ 2023-03-07 12:40 UTC (permalink / raw) To: marcandre.lureau; +Cc: qemu-devel, armbru On Tue, Mar 07, 2023 at 04:30:27PM +0400, marcandre.lureau@redhat.com wrote: > From: Marc-André Lureau <marcandre.lureau@redhat.com> > > This seems to be the preferred style. > > The EditorConfig property is not supported by all editors: > https://github.com/editorconfig/editorconfig/wiki/EditorConfig-Properties#max_line_length > > Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> > --- > .editorconfig | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/.editorconfig b/.editorconfig > index 7303759ed7..8c5ebc6a1b 100644 > --- a/.editorconfig > +++ b/.editorconfig > @@ -47,3 +47,4 @@ emacs_mode = glsl > [*.json] > indent_style = space > emacs_mode = python > +max_line_length = 70 Why 70 as a hard limit ? I thought QEMU policy was that 80 was a soft limit and we were happy with 90 if it avoided wrapping that would hurt readability. With regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :| ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] .editorconfig: set max line at 70 chars for QAPI files 2023-03-07 12:40 ` Daniel P. Berrangé @ 2023-03-07 12:55 ` Marc-André Lureau 2023-03-07 13:09 ` Markus Armbruster 1 sibling, 0 replies; 6+ messages in thread From: Marc-André Lureau @ 2023-03-07 12:55 UTC (permalink / raw) To: Daniel P. Berrangé; +Cc: qemu-devel, armbru Hi On Tue, Mar 7, 2023 at 4:41 PM Daniel P. Berrangé <berrange@redhat.com> wrote: > > On Tue, Mar 07, 2023 at 04:30:27PM +0400, marcandre.lureau@redhat.com wrote: > > From: Marc-André Lureau <marcandre.lureau@redhat.com> > > > > This seems to be the preferred style. > > > > The EditorConfig property is not supported by all editors: > > https://github.com/editorconfig/editorconfig/wiki/EditorConfig-Properties#max_line_length > > > > Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> > > --- > > .editorconfig | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/.editorconfig b/.editorconfig > > index 7303759ed7..8c5ebc6a1b 100644 > > --- a/.editorconfig > > +++ b/.editorconfig > > @@ -47,3 +47,4 @@ emacs_mode = glsl > > [*.json] > > indent_style = space > > emacs_mode = python > > +max_line_length = 70 > > Why 70 as a hard limit ? I thought QEMU policy was that 80 was a soft > limit and we were happy with 90 if it avoided wrapping that would hurt > readability. Markus regularly point out lines over 70 characters: https://patchew.org/QEMU/20230306122751.2355515-1-marcandre.lureau@redhat.com/20230306122751.2355515-9-marcandre.lureau@redhat.com/#871qm1j2zc.fsf@pond.sub.org (my default emacs config has fill-column 80, and I use fill-paragraph - although sometime I may forget it) ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] .editorconfig: set max line at 70 chars for QAPI files 2023-03-07 12:40 ` Daniel P. Berrangé 2023-03-07 12:55 ` Marc-André Lureau @ 2023-03-07 13:09 ` Markus Armbruster 1 sibling, 0 replies; 6+ messages in thread From: Markus Armbruster @ 2023-03-07 13:09 UTC (permalink / raw) To: Daniel P. Berrangé; +Cc: marcandre.lureau, qemu-devel Daniel P. Berrangé <berrange@redhat.com> writes: > On Tue, Mar 07, 2023 at 04:30:27PM +0400, marcandre.lureau@redhat.com wrote: >> From: Marc-André Lureau <marcandre.lureau@redhat.com> >> >> This seems to be the preferred style. >> >> The EditorConfig property is not supported by all editors: >> https://github.com/editorconfig/editorconfig/wiki/EditorConfig-Properties#max_line_length >> >> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> >> --- >> .editorconfig | 1 + >> 1 file changed, 1 insertion(+) >> >> diff --git a/.editorconfig b/.editorconfig >> index 7303759ed7..8c5ebc6a1b 100644 >> --- a/.editorconfig >> +++ b/.editorconfig >> @@ -47,3 +47,4 @@ emacs_mode = glsl >> [*.json] >> indent_style = space >> emacs_mode = python >> +max_line_length = 70 > > Why 70 as a hard limit ? I thought QEMU policy was that 80 was a soft > limit and we were happy with 90 if it avoided wrapping that would hurt > readability. We have the rule because we're tired of arguing about readability of long lines all the time. But readability should trump rules! Long lines are hard to read. It's not a matter of window width. Humans tend to have trouble following long lines with their eyes (I sure do). Typographic manuals suggest to limit columns to roughly 60 characters for exactly that reason[*]. Wider windows do help with heavily indented material, as long as the text itself isn't too wide. Occasionally, there's simply no good way to break a long line without making it *less* readable. We should accept the long line as the lesser evil then. The QAPI schema files consist of ~4,000 lines of code, ~18,000 lines of doc comments, and ~1000 blank lines. 1150 lines exceed 75 characters. 271 exceed 80 characters. Mostly doc strings, and mostly due to carelessness, not necessity. Some doc strings are heavily indented[**], and letting these go over the limit can be okay. We should employ good taste. Unfortunately, that seems to be in short supply. Rules are a poor substitute, but here we are. When I review QAPI schema patches, I flag unnecessary long lines. I don't intend to stop that :) [*] https://en.wikipedia.org/wiki/Column_(typography)#Typographic_style [**] Caused by unfortunate doc string syntax; wish I had the time to fix it ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] .editorconfig: set max line at 70 chars for QAPI files 2023-03-07 12:30 [PATCH] .editorconfig: set max line at 70 chars for QAPI files marcandre.lureau 2023-03-07 12:40 ` Daniel P. Berrangé @ 2023-03-21 7:30 ` Marc-André Lureau 2023-03-21 13:53 ` Markus Armbruster 1 sibling, 1 reply; 6+ messages in thread From: Marc-André Lureau @ 2023-03-21 7:30 UTC (permalink / raw) To: qemu-devel; +Cc: armbru Hi On Tue, Mar 7, 2023 at 4:32 PM <marcandre.lureau@redhat.com> wrote: > > From: Marc-André Lureau <marcandre.lureau@redhat.com> > > This seems to be the preferred style. > > The EditorConfig property is not supported by all editors: > https://github.com/editorconfig/editorconfig/wiki/EditorConfig-Properties#max_line_length > > Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> > --- > .editorconfig | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/.editorconfig b/.editorconfig > index 7303759ed7..8c5ebc6a1b 100644 > --- a/.editorconfig > +++ b/.editorconfig > @@ -47,3 +47,4 @@ emacs_mode = glsl > [*.json] > indent_style = space > emacs_mode = python > +max_line_length = 70 ack or nack ? ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] .editorconfig: set max line at 70 chars for QAPI files 2023-03-21 7:30 ` Marc-André Lureau @ 2023-03-21 13:53 ` Markus Armbruster 0 siblings, 0 replies; 6+ messages in thread From: Markus Armbruster @ 2023-03-21 13:53 UTC (permalink / raw) To: Marc-André Lureau; +Cc: qemu-devel Marc-André Lureau <marcandre.lureau@gmail.com> writes: > Hi > > On Tue, Mar 7, 2023 at 4:32 PM <marcandre.lureau@redhat.com> wrote: >> >> From: Marc-André Lureau <marcandre.lureau@redhat.com> >> >> This seems to be the preferred style. >> >> The EditorConfig property is not supported by all editors: >> https://github.com/editorconfig/editorconfig/wiki/EditorConfig-Properties#max_line_length >> >> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> >> --- >> .editorconfig | 1 + >> 1 file changed, 1 insertion(+) >> >> diff --git a/.editorconfig b/.editorconfig >> index 7303759ed7..8c5ebc6a1b 100644 >> --- a/.editorconfig >> +++ b/.editorconfig >> @@ -47,3 +47,4 @@ emacs_mode = glsl >> [*.json] >> indent_style = space >> emacs_mode = python >> +max_line_length = 70 > > ack or nack ? I think we should first address the doc syntax misfeature that pushes us to the right, and clean up existing overlong lines. Can't say how hard the former would be, so I'm having a look. ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-03-21 13:54 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2023-03-07 12:30 [PATCH] .editorconfig: set max line at 70 chars for QAPI files marcandre.lureau 2023-03-07 12:40 ` Daniel P. Berrangé 2023-03-07 12:55 ` Marc-André Lureau 2023-03-07 13:09 ` Markus Armbruster 2023-03-21 7:30 ` Marc-André Lureau 2023-03-21 13:53 ` Markus Armbruster
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).