From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id g54CGCw7jGBTawAAWB0awg (envelope-from ) for ; Fri, 30 Apr 2021 13:15:24 -0400 Received: by simark.ca (Postfix, from userid 112) id 52B9E1F11C; Fri, 30 Apr 2021 13:15:24 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 93F1B1E813 for ; Fri, 30 Apr 2021 13:15:23 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1ABDF386101E; Fri, 30 Apr 2021 17:15:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1ABDF386101E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1619802923; bh=273LeMvR1VmHGT+Svz+yrgo0o1utPlWtRpzFtbdVFPY=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=goyFNKK63EmpiRrNySfrUoUkwSf4+OhWOM+1hJlnDnNkp1in9VkB40vSur0BmYI0V x7kpy6qzP8x70Ke2AEGhy18CGDFexIL9eMFcC95OMbDWdB8PF4uiq99mMjSlIWs9/z FJC3hqsEsRUz35QeyANq64fV7bDOErm3fR9G0Xog= Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id DD5BE3860C3E for ; Fri, 30 Apr 2021 17:15:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org DD5BE3860C3E Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 13UHECB4004190 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 30 Apr 2021 13:14:17 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 13UHECB4004190 Received: from [10.0.0.11] (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 912641E813; Fri, 30 Apr 2021 13:14:12 -0400 (EDT) Subject: Re: Proposal: format GDB Python files with black To: Tom Tromey , Lancelot SIX via Gdb-patches References: <20210426224012.i5gaiqjbkjsmre4k@gwenhwyvar> <87h7jnwvnp.fsf@tromey.com> Message-ID: <4e80b144-0701-9240-f216-0cc23982379c@polymtl.ca> Date: Fri, 30 Apr 2021 13:14:12 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <87h7jnwvnp.fsf@tromey.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Fri, 30 Apr 2021 17:14:12 +0000 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: , From: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Cc: Lancelot SIX Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" On 2021-04-30 1:04 p.m., Tom Tromey wrote: >>>>>> "Lancelot" == Lancelot SIX via Gdb-patches writes: > > Lancelot> Another option can be to use 'black' to > Lancelot> help format the code and 'pycodestyle'[3] to do the automated checks, > Lancelot> but I am not sure this is the way you want to go to, introducing more > Lancelot> and more tools. > > 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. 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. Simon