From: Simon Marchi <simark@simark.ca>
To: Ruslan Kabatsayev <b7.10110111@gmail.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH v3] Align natural-format register values to the same column
Date: Sat, 03 Feb 2018 15:55:00 -0000 [thread overview]
Message-ID: <87b8b9de-1a29-0470-a65b-784475502473@simark.ca> (raw)
In-Reply-To: <CAHEcG94ddJpvsZoqQ+dw3HfSaG_15gKhffXxRXHTrbXZz7hXCg@mail.gmail.com>
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
next prev parent reply other threads:[~2018-02-03 15:55 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-19 7:22 Ruslan Kabatsayev
2018-02-03 4:46 ` Simon Marchi
2018-02-03 11:43 ` Ruslan Kabatsayev
2018-02-03 15:55 ` Simon Marchi [this message]
2018-02-03 16:15 ` Ruslan Kabatsayev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87b8b9de-1a29-0470-a65b-784475502473@simark.ca \
--to=simark@simark.ca \
--cc=b7.10110111@gmail.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox