From: Richard Sandiford <richard.sandiford@arm.com>
To: "Martin Liška" <mliska@suse.cz>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [DOCS] Python Language Conventions
Date: Thu, 13 Oct 2022 15:05:43 +0100 [thread overview]
Message-ID: <mptr0zbbyyw.fsf@arm.com> (raw)
In-Reply-To: <019f73ee-23aa-6bca-4ed8-93fbd86ed279@suse.cz> ("Martin \=\?utf-8\?Q\?Li\=C5\=A1ka\=22's\?\= message of "Thu, 13 Oct 2022 12:16:56 +0200")
Martin Liška <mliska@suse.cz> writes:
> On 10/13/22 12:03, Richard Sandiford wrote:
>> Martin Liška <mliska@suse.cz> writes:
>>> I think we should add how Python scripts should be formatted. I noticed
>>> that while reading the Modula-2 patchset where it follows the C/C++ style
>>> when it comes to Python files.
>>>
>>> Ready to be installed?
>>> Thanks,
>>> Martin
>>
>> Did you consider requiring black formatting instead? Maybe black -l79
>> to maintain the usual 80-character limit.
>
> No, the automatic formatting might be a next step. About 80 chars, can we relax
> that for Python scripts? I think it's hairy restriction these days.
In practice it seems to work well, even at 79 chars. The default is 88
and I don't think the extra 8 or 9 columns are enough to make a different
rule for Python worth it.
FWIW, personally I use an 80-column editor for GCC stuff, and it would
be a pain to have to switch to something different to work on Python.
>> At least that way there's only one right answer.
>
> Yep. We can definitely recommend using black as an optional approach,
> what do you think?
IMO the real value is if it's the defined approach, rather than an
optional approach. It's "format and forget", just like with clang-format.
Thanks,
Richard
prev parent reply other threads:[~2022-10-13 14:05 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-13 9:37 Martin Liška
2022-10-13 9:44 ` Gerald Pfeifer
2022-10-13 17:16 ` David Malcolm
2022-10-13 20:58 ` Gaius Mulley
2022-10-17 13:06 ` Martin Liška
2022-10-20 11:34 ` Gerald Pfeifer
2022-10-20 11:53 ` Martin Liška
2022-10-13 10:03 ` Richard Sandiford
2022-10-13 10:16 ` Martin Liška
2022-10-13 14:05 ` Richard Sandiford [this message]
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=mptr0zbbyyw.fsf@arm.com \
--to=richard.sandiford@arm.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=mliska@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).