From: Rob Herring <robh@kernel.org>
To: Joe Perches <joe@perches.com>
Cc: devicetree@vger.kernel.org,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE"
<linux-arm-kernel@lists.infradead.org>,
linux-clk <linux-clk@vger.kernel.org>,
dri-devel <dri-devel@lists.freedesktop.org>,
linux-spi <linux-spi@vger.kernel.org>,
"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
"open list:REMOTE PROCESSOR (REMOTEPROC) SUBSYSTEM"
<linux-remoteproc@vger.kernel.org>,
Linux HWMON List <linux-hwmon@vger.kernel.org>,
Linux I2C <linux-i2c@vger.kernel.org>,
Linux Fbdev development list <linux-fbdev@vger.kernel.org>,
"open list:IIO SUBSYSTEM AND DRIVERS" <linux-iio@vger.kernel.org>,
Linux Input <linux-input@vger.kernel.org>,
"open list:THERMAL" <linux-pm@vger.kernel.org>,
Linux Media Mailing List <linux-media@vger.kernel.org>,
Linux-ALSA <alsa-devel@alsa-project.org>,
linux-mmc <linux-mmc@vger.kernel.org>,
MTD Maling List <linux-mtd@lists.infradead.org>,
netdev <netdev@vger.kernel.org>,
"open list:REAL TIME CLOCK (RTC) SUBSYSTEM"
<linux-rtc@vger.kernel.org>,
"open list:SERIAL DRIVERS" <linux-serial@vger.kernel.org>,
Linux USB List <linux-usb@vger.kernel.org>
Subject: Re: [PATCH] dt-bindings: Whitespace clean-ups in schema files
Date: Wed, 12 Aug 2020 17:05:08 -0600 [thread overview]
Message-ID: <CAL_JsqKBzqMHMMRwBJUjomxOpZAop_+TXBjLCb6ntwZzNMy=3Q@mail.gmail.com> (raw)
In-Reply-To: <f5dedf2d8d8057de3eaa2f9126f44cebb0653b09.camel@perches.com>
On Wed, Aug 12, 2020 at 4:32 PM Joe Perches <joe@perches.com> wrote:
>
> On Wed, 2020-08-12 at 14:36 -0600, Rob Herring wrote:
> > Clean-up incorrect indentation, extra spaces, long lines, and missing
> > EOF newline in schema files. Most of the clean-ups are for list
> > indentation which should always be 2 spaces more than the preceding
> ^
> > keyword.
keyword is the key part...
> []
> > diff --git a/Documentation/devicetree/bindings/arm/arm,integrator.yaml b/Documentation/devicetree/bindings/arm/arm,integrator.yaml
> > index 192ded470e32..f0daf990e077 100644
> > --- a/Documentation/devicetree/bindings/arm/arm,integrator.yaml
> > +++ b/Documentation/devicetree/bindings/arm/arm,integrator.yaml
> > @@ -67,9 +67,9 @@ patternProperties:
> > compatible:
> > items:
> > - enum:
> > - - arm,integrator-ap-syscon
> > - - arm,integrator-cp-syscon
> > - - arm,integrator-sp-syscon
> > + - arm,integrator-ap-syscon
> > + - arm,integrator-cp-syscon
> > + - arm,integrator-sp-syscon
>
> Confused a bit here.
> - enum:
> 10 spaces to dash
> old line:
> - arm,integrator-ap-syscon
> 12 spaces to dash
> new line:
> - arm,integrator-ap-syscon
> 14 spaces to dash
>
> Is it supposed to be 2 spaces more than the preceding line
> or 4 more?
If the preceding line is a list entry (i.e. starts with '-'), then
it's 4 more spaces. It's always 2 more spaces than the preceding
keyword start (aka json-schema vocabulary).
Arguably, this style is a bit inconsistent in that the '-' counts
toward as indentation of the current line, but not the preceding line.
However, I think this style is a bit less error prone and easier to
review. With the other style (always N more spaces) it's harder to
distinguish lists vs. dicts. For example, you can have something like
this:
- key:
- foo
- bar
- key:
foo
bar
- key:
- foo
bar
All 3 of these could be valid. Which one was intended? (Can't really
tell here, but you can with actual DT schema.)
Rob
next prev parent reply other threads:[~2020-08-12 23:05 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20200812203618.2656699-1-robh@kernel.org>
2020-08-12 21:34 ` [PATCH] dt-bindings: Whitespace clean-ups in schema files Sam Ravnborg
2020-08-12 22:41 ` Rob Herring
2020-08-16 8:44 ` Jonathan Cameron
2020-08-12 22:32 ` Joe Perches
2020-08-12 23:05 ` Rob Herring [this message]
2020-08-13 7:50 ` Geert Uytterhoeven
2020-08-13 10:31 ` Luca Ceresoli
2020-08-14 14:51 ` Rob Herring
2020-08-14 16:30 ` Luca Ceresoli
2020-08-25 7:10 ` Wolfram Sang
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='CAL_JsqKBzqMHMMRwBJUjomxOpZAop_+TXBjLCb6ntwZzNMy=3Q@mail.gmail.com' \
--to=robh@kernel.org \
--cc=alsa-devel@alsa-project.org \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=joe@perches.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-remoteproc@vger.kernel.org \
--cc=linux-rtc@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=netdev@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).