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 C5A5F386C587 for ; Thu, 13 Oct 2022 10:03:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C5A5F386C587 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 92E0515A1; Thu, 13 Oct 2022 03:03:50 -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 E03543F792; Thu, 13 Oct 2022 03:03:43 -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: Date: Thu, 13 Oct 2022 11:03:42 +0100 In-Reply-To: ("Martin \=\?utf-8\?Q\?Li\=C5\=A1ka\=22's\?\= message of "Thu, 13 Oct 2022 11:37:47 +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=-44.3 required=5.0 tests=BAYES_00,GIT_PATCH_0,KAM_DMARC_NONE,KAM_DMARC_STATUS,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham 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: > 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. At least that way there's only one right answer. Richard > > --- > htdocs/codingconventions.html | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) > > diff --git a/htdocs/codingconventions.html b/htdocs/codingconventions.html > index e4d30510..180ef35a 100644 > --- a/htdocs/codingconventions.html > +++ b/htdocs/codingconventions.html > @@ -80,6 +80,7 @@ the conventions separately from any other changes to th= e code.

> > > > +
  • Python Language Conventions > >=20=20 >=20=20 > @@ -1483,6 +1484,19 @@ with a right brace, optional closing comment, and = a new line. > Definitions within the body of a namespace are not indented. >

    >=20=20 > +

    Python Language Conventions

    > + > +

    > +Python scripts should follow PEP 8 =E2=80=93 Style Guide for Python Code > +which can be verified by flake8 tool. > +We do also recommend using the following flake8 plug-ins: > + > +

      > +
    • flake8-builtins
    • > +
    • flake8-import-order
    • > +
    • flake8-quotes
    • > +
    > +

    >=20=20 > >