From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 50205 invoked by alias); 3 Feb 2018 15:55:56 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 50156 invoked by uid 89); 3 Feb 2018 15:55:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-HELO: simark.ca Received: from simark.ca (HELO simark.ca) (158.69.221.121) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 03 Feb 2018 15:55:54 +0000 Received: from [10.0.0.11] (192-222-251-162.qc.cable.ebox.net [192.222.251.162]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 4619D1E093; Sat, 3 Feb 2018 10:55:53 -0500 (EST) Subject: Re: [PATCH v3] Align natural-format register values to the same column To: Ruslan Kabatsayev Cc: gdb-patches@sourceware.org References: <1516346545-8217-1-git-send-email-b7.10110111@gmail.com> From: Simon Marchi Message-ID: <87b8b9de-1a29-0470-a65b-784475502473@simark.ca> Date: Sat, 03 Feb 2018 15:55:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2018-02/txt/msg00050.txt.bz2 On 2018-02-03 06:43 AM, Ruslan Kabatsayev wrote: > I'm extremely sorry for making you repeat your comments. I keep > missing some formatting bits. Are there any known-working options for > any linter/indenter so that I could automatically check/prettify my > GDB patches before posting? I've tried astyle, but it somehow messes > up spaces/tabs and doesn't seem to support half-indenting enum braces > (or I didn't use the correct options). GNU indent appears to confuse > C++ references with bitwise OR, putting spaces on both sides, and also > doesn't want to half-indent enums. I don't know of any tool/config that does it right out of the box, but if you manage to find a solution that works nicely, please share it. The problem is often that if you run files through an automatic formatter, you'll have a huge diff of little changes (fix existing style issues, change how things are wrapped, etc). If there was a way to tell the formatter to only touch the lines that were touched in your patch, it would be ideal. What do you mean by half-indent enum, do you mean that the curly braces are indented with respect to the enum keywork, like this? enum tab_stops { value_column_1 = 15, /* Give enough room for "0x", 16 hex digits and two spaces in preceding column. */ value_column_2 = value_column_1 + 2 + 16 + 2, }; I've seen inconsistent style in GDB between the above, and this: enum tab_stops { value_column_1 = 15, /* Give enough room for "0x", 16 hex digits and two spaces in preceding column. */ value_column_2 = value_column_1 + 2 + 16 + 2, }; I think the second version makes more sense, because it mimics how it's done for functions. But I don't know if it should be different if the enum is declared inside the scope of a function. If your formatter writes it like the second version, I would be totally fine with it. > I've sent a new version of the patch. Thanks, I'll look at it later. Simon