[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v7 06/10] iotests: limit line length to 79 chars
From: |
John Snow |
Subject: |
Re: [PATCH v7 06/10] iotests: limit line length to 79 chars |
Date: |
Wed, 4 Mar 2020 18:14:10 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 |
On 3/4/20 4:58 PM, Philippe Mathieu-Daudé wrote:
> Do we want to indent Python like C and align argument below opening
> parenthesis? Except when using sys.stderr.write() you seem to do it.
This isn't an argument to write, it's an argument to the format string,
so I will say "no."
For *where* I've placed the line break, this is the correct indentation.
emacs's python mode will settle on this indent, too.
https://python.org/dev/peps/pep-0008/#indentation
(If anyone quotes Guido's belittling comment in this email, I will
become cross.)
But there are other places to put the line break. This is also
technically valid:
sys.stderr.write('qemu-img received signal %i: %s\n'
% (-exitcode, ' '.join(qemu_img_args + list(args))))
And so is this:
sys.stderr.write('qemu-img received signal %i: %s\n' %
(-exitcode, ' '.join(qemu_img_args + list(args))))
(And so would be any other number of rewrites to use format codes,
f-strings, or temporary variables to otherwise reduce the length of the
line.)
I will reluctantly admit that wrapping to 79 columns is useful in some
contexts. The beauty of line continuations is something I have little
desire to litigate, though.
If there's some consensus on the true and beautiful way to do it, I will
oblige -- but the thought of spinning more iterations until we find a
color swatch we like is an unpleasant one.
--js
- Re: [PATCH v7 01/10] iotests: do a light delinting, (continued)
- [PATCH v7 03/10] iotests: ignore import warnings from pylint, John Snow, 2020/03/04
- [PATCH v7 08/10] iotest 258: use script_main, John Snow, 2020/03/04
- [PATCH v7 05/10] iotests: add pylintrc file, John Snow, 2020/03/04
- [PATCH v7 07/10] iotests: add script_initialize, John Snow, 2020/03/04
- [PATCH v7 09/10] iotests: Mark verify functions as private, John Snow, 2020/03/04
- [PATCH v7 10/10] iotests: use python logging for iotests.log(), John Snow, 2020/03/04
- [PATCH v7 06/10] iotests: limit line length to 79 chars, John Snow, 2020/03/04
- Re: [PATCH v7 06/10] iotests: limit line length to 79 chars, Philippe Mathieu-Daudé, 2020/03/04
- Re: [PATCH v7 06/10] iotests: limit line length to 79 chars,
John Snow <=
- Re: [PATCH v7 06/10] iotests: limit line length to 79 chars, Kevin Wolf, 2020/03/05
- Re: [PATCH v7 06/10] iotests: limit line length to 79 chars, John Snow, 2020/03/05
- Re: [PATCH v7 06/10] iotests: limit line length to 79 chars, Kevin Wolf, 2020/03/06
- Re: [PATCH v7 06/10] iotests: limit line length to 79 chars, John Snow, 2020/03/06
- Re: [PATCH v7 06/10] iotests: limit line length to 79 chars, Markus Armbruster, 2020/03/07