From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id A36A83858404 for ; Thu, 13 Oct 2022 14:05:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A36A83858404 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 69F28113E; Thu, 13 Oct 2022 07:05:51 -0700 (PDT) Received: from localhost (e121540-lin.manchester.arm.com [10.32.98.62]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B79603F67D; Thu, 13 Oct 2022 07:05:44 -0700 (PDT) From: Richard Sandiford To: Martin =?utf-8?Q?Li=C5=A1ka?= Mail-Followup-To: Martin =?utf-8?Q?Li=C5=A1ka?= ,gcc-patches@gcc.gnu.org, richard.sandiford@arm.com Cc: gcc-patches@gcc.gnu.org Subject: Re: [DOCS] Python Language Conventions References: <019f73ee-23aa-6bca-4ed8-93fbd86ed279@suse.cz> Date: Thu, 13 Oct 2022 15:05:43 +0100 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") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-38.2 required=5.0 tests=BAYES_00,KAM_DMARC_NONE,KAM_DMARC_STATUS,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Martin Li=C5=A1ka writes: > On 10/13/22 12:03, Richard Sandiford wrote: >> Martin Li=C5=A1ka 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++ sty= le >>> when it comes to Python files. >>> >>> Ready to be installed? >>> Thanks, >>> Martin >>=20 >> 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.=20 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