From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id wYt4HKk8jGCCawAAWB0awg (envelope-from ) for ; Fri, 30 Apr 2021 13:21:45 -0400 Received: by simark.ca (Postfix, from userid 112) id 67A161F11C; Fri, 30 Apr 2021 13:21:45 -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 A7D861E813 for ; Fri, 30 Apr 2021 13:21:44 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 59EA4385803B; Fri, 30 Apr 2021 17:21:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 59EA4385803B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1619803304; bh=gHhzi6TwdV0tX1a4SqzLJlsZPBboXgpl+foiTql1iGg=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=Qnn2y1r2J4WEEhFoUXTbUQd76bxmA/+zrbkkDMZbfswtxTGcSj2gTL616T0MD74g+ aAjF99wbEADKy/x0g+ok5OvcbdaWaoY4DZralDxFt6pXeJ/Lyvwzr+VHvE7DDj2cnl XuObKhyvWULDg+56qBQDWfwR20pdot+3yLj8Sigo= Received: from mail-qv1-xf33.google.com (mail-qv1-xf33.google.com [IPv6:2607:f8b0:4864:20::f33]) by sourceware.org (Postfix) with ESMTPS id 2D36E385803B for ; Fri, 30 Apr 2021 17:21:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 2D36E385803B Received: by mail-qv1-xf33.google.com with SMTP id i8so5077823qvv.0 for ; Fri, 30 Apr 2021 10:21:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=gHhzi6TwdV0tX1a4SqzLJlsZPBboXgpl+foiTql1iGg=; b=DgM1hUfG5FfPx1TMYYSxsviBuTqvWrQFXWaTzK/JG0LCPs5kyexx3voNciwtoQOjQS oeRG+6gyCA8lfZE0wz1qp4tVhPEZADJqLkFxMnhJTyXFuX/iaXZdBWdynmZdInbB888P TF7Fw+ui7SoqGBPIU9vS6E2ti0WDX6aORmw1+Gyy5xqeJbItnTD0DYmygmJMBw+3s7Vd 7vGG/XEIezP3CRcesAALBNeoQKhrP689QbT7cfq8MoM8o0aM+w601b3Joz2CafjNxENX A0t3AUUF6WQjI1WlfK8VkrmaCb+Wcik/+T8YyLyQZF1rLpRGBCyprZ8cl+Y7S/+l5UTw 0WIA== X-Gm-Message-State: AOAM531s1bC/++A0WMcWNA9rjktZIPzM7BHnH8hXIAic9FKKPsc5BPWh 6l604WadyrzunvUtsZYfhGMVapAD4yw2Gg== X-Google-Smtp-Source: ABdhPJwB5HUhbdiUvWXioIQa77dwsP9896C8J/pqpk8jqqEStI1p9gKATpkvdP/oRutl3ClQv+jW6g== X-Received: by 2002:a05:6214:51:: with SMTP id c17mr1375157qvr.29.1619803301699; Fri, 30 Apr 2021 10:21:41 -0700 (PDT) Received: from ?IPv6:2804:7f0:4841:2d9e:cc13:2f1e:30bb:9188? ([2804:7f0:4841:2d9e:cc13:2f1e:30bb:9188]) by smtp.gmail.com with ESMTPSA id y29sm2717623qtm.13.2021.04.30.10.21.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 30 Apr 2021 10:21:41 -0700 (PDT) Subject: Re: Proposal: format GDB Python files with black To: Simon Marchi , gdb-patches@sourceware.org References: Message-ID: <716ebc67-05c8-5689-f26b-71b2060f127d@linaro.org> Date: Fri, 30 Apr 2021 14:21:38 -0300 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: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit 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: Luis Machado via Gdb-patches Reply-To: Luis Machado Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" On 4/26/21 12:55 PM, Simon Marchi via Gdb-patches wrote: > Hi all, > > A few people I talked to about this and I have good experience with the > tool black to auto-format Python code. It is simple to use, fast and > reliable (if it detects that it changed the meaning of the program by > mistake, internal-errors out). I don't think I need to spell out the > advantage of using such a tool, but just in case: it removes all the > overhead of thinking about formatting when writing or reviewing code. > > My suggestion would be to format our code with black all at once. The > typical counter-argument to this is "it will be harder to use > git-blame". I don't think this is true, because you need to be able to > skip over commits anyway, and it's trivial to skip over a commit when > git-blaming using an interactive tool. But it's also possible to tell > git to ignore certain commits when git-blaming [2], so we can do that. > > I think the output of black is quite readable. When it does weird > stuff, it's generally because the lines / expressions are two long > anyway, and deserve to be split in multiple lines / expressions. Here's > a branch that shows how it would look like: > > https://sourceware.org/git/?p=binutils-gdb.git;a=shortlog;h=refs/heads/users/simark/black > > If the feedback is overall positive, I'll send a more format patch. > > Simon > > [1] https://github.com/psf/black > [2] https://github.com/psf/black#migrating-your-code-style-without-ruining-git-blame > FTR, I like this too.