Gentoo Archives: gentoo-portage-dev

From: Zac Medico <zmedico@g.o>
To: gentoo-portage-dev@l.g.o, Brian Dolbec <dolsen@g.o>
Subject: Re: [gentoo-portage-dev] [PROPOSAL] Don't split user visible messages across multiple lines
Date: Sun, 13 Aug 2017 21:36:21
Message-Id: c3ed36bc-9ce9-7d3b-53fd-0b5883056c6b@gentoo.org
In Reply to: Re: [gentoo-portage-dev] [PROPOSAL] Don't split user visible messages across multiple lines by Brian Dolbec
1 On 03/15/2017 03:32 PM, Brian Dolbec wrote:
2 > On Mon, 27 Feb 2017 20:33:28 +0200
3 > Alexandru Elisei <alexandru.elisei@×××××.com> wrote:
4 >
5 >> I was working on emerge --sync and my test repo configuration
6 >> generated several warning messages. Finding the exact location where
7 >> the warnings was generated was surprisingly difficult because the
8 >> message string was split across three lines due to the 80 character
9 >> line limit and I had to grep for different patterns until I found one
10 >> that matched part of a line.
11 >>
12 >> I propose that messages that are visible to the user never be split
13 >> across multiple lines. This is also the coding style convention used
14 >> by the linux kernel:
15 >> https://www.kernel.org/doc/html/latest/process/coding-style.html#breaking-long-lines-and-strings
16 >>
17 >> If accepted, this could go in the DEVELOPING file.
18 >>
19 >
20 > That could be pretty hard to do for all messages.
21 > Especially messages with embedded data
22 >
23 > eg: "%s is missing %s required use flag..." % ('sys-apps/foo', 'bar')
24 >
25 >
26 > I know I don't always enforce the line length for a few characters,
27 > also when clarity is more important than line length.
28 >
29 > We could also increase the max. line length to something like 120 or 130.
30
31 Just because your monitor allows you to fit more characters on a line,
32 doesn't mean that you should. Try a google search for "optimal line
33 length for readability" and you'll find that there are more factors to
34 consider than monitor size. The wider the line, the more difficult it is
35 for the eye to find the beginning of the next line. So, you end up
36 wasting time just trying to find the beginning of the next line.
37 --
38 Thanks,
39 Zac