From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from rock.gnat.com (rock.gnat.com [IPv6:2620:20:4000:0:a9e:1ff:fe9b:1d1]) by sourceware.org (Postfix) with ESMTP id EE70E38515E6 for ; Sat, 1 May 2021 06:42:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org EE70E38515E6 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=brobecker@adacore.com Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 630A156354; Sat, 1 May 2021 02:42:13 -0400 (EDT) X-Virus-Scanned: Debian amavisd-new at gnat.com Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 9cQdDoFZRnns; Sat, 1 May 2021 02:42:13 -0400 (EDT) Received: from float.home (localhost.localdomain [127.0.0.1]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by rock.gnat.com (Postfix) with ESMTPS id 21B6456352; Sat, 1 May 2021 02:42:12 -0400 (EDT) Received: by float.home (Postfix, from userid 1000) id AB4F0A123E; Sat, 1 May 2021 10:42:10 +0400 (+04) Date: Fri, 30 Apr 2021 23:42:10 -0700 From: Joel Brobecker To: Simon Marchi via Gdb-patches Cc: Tom Tromey , Lancelot SIX Subject: Re: Proposal: format GDB Python files with black Message-ID: <20210501064210.GA6230@adacore.com> References: <20210426224012.i5gaiqjbkjsmre4k@gwenhwyvar> <87h7jnwvnp.fsf@tromey.com> <4e80b144-0701-9240-f216-0cc23982379c@polymtl.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4e80b144-0701-9240-f216-0cc23982379c@polymtl.ca> X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 May 2021 06:42:16 -0000 > > Doing some kind of checking like this would be good as well. > > We've used pycodestyle internally a bit, but recently (-ish) moved to > > flake8. I don't know why we made the switch or which static checker is > > preferable, though. flake8 does more, as it is a wrapper around pyflakes and pycodestyle. > > I have used flake8 for a long time, I'm happy with it. It does find > some real bugs, like a variable being referenced without being assigned, > things like that, so it has real value. > > > Lancelot> I’d also like to point out that by default, 'black' will use 88 char > > Lancelot> long lines[4], which is not compliant with the PEP8[5], which is, as you > > Lancelot> pointed out[1], referenced in GDB's wiki[6]. Either the tool's > > Lancelot> configuration or the standard can be adjusted, depending on the > > Lancelot> maintainers preferences. > > > > We only really chose PEP8 because it existed; not out of some deeper > > liking for it or anything like that. So personally I'm fine with just > > switching to a tool. > > Although PEP8 specifies more than just formatting, like naming > convention and things like that. So for the wiki, which mentions PEP8 > currently, I plan on saying something like "Use black for the > formatting. For the rest, follow PEP8.". > > Let's just use black's default line length. I certainly don't want to > start a discussion on line length, and I don't see any reason to deviate > from the default. Agreed. One other thing that I thought about is perhaps we can look at writing a server-side hook that would be run at commit time which would run those checks before accepting them. The git-hooks we are using provide support for adding extra checks via the "hooks.commit-extra-checker" option. I'm not 100% about how easy or difficult it would be to write the actual script that would reproduce the issue, though. -- Joel