linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH BlueZ] doc/coding-style: Allow spaces after tabs for indenting wrapped lines
@ 2020-09-16 23:29 Sonny Sasaka
  2020-09-16 23:36 ` Luiz Augusto von Dentz
  2020-10-01  7:16 ` Marcel Holtmann
  0 siblings, 2 replies; 5+ messages in thread
From: Sonny Sasaka @ 2020-09-16 23:29 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Sonny Sasaka

The "only tabs for indentation" rule was enforced long ago to align with
Linux kernel net coding style. This is no longer the case today so we
are relaxing the coding style to allow spaces after tabs if it can
increase readability.

---
 doc/coding-style.txt | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/doc/coding-style.txt b/doc/coding-style.txt
index f0bf880e3..6a7415847 100644
--- a/doc/coding-style.txt
+++ b/doc/coding-style.txt
@@ -104,9 +104,16 @@ void btd_adapter_register_pin_cb(struct btd_adapter *adapter,
 void btd_adapter_register_pin_cb(struct btd_adapter *adapter,
 							btd_adapter_pin_cb_t cb)
 
+5)
+void btd_adapter_register_pin_cb(struct btd_adapter *adapter,
+				 btd_adapter_pin_cb_t cb)
+
 The referred style for line wrapping is to indent as far as possible to the
 right without hitting the 80 columns limit.
 
+It is acceptable to add padding with spaces after tabs to increase
+readability, for example to indent function arguments at the parenthesis.
+
 M5: Space when doing type casting
 =================================
 
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH BlueZ] doc/coding-style: Allow spaces after tabs for indenting wrapped lines
  2020-09-16 23:29 [PATCH BlueZ] doc/coding-style: Allow spaces after tabs for indenting wrapped lines Sonny Sasaka
@ 2020-09-16 23:36 ` Luiz Augusto von Dentz
  2020-10-01  7:16 ` Marcel Holtmann
  1 sibling, 0 replies; 5+ messages in thread
From: Luiz Augusto von Dentz @ 2020-09-16 23:36 UTC (permalink / raw)
  To: Sonny Sasaka; +Cc: linux-bluetooth, Marcel Holtmann

Hi Marcel,

On Wed, Sep 16, 2020 at 4:31 PM Sonny Sasaka <sonnysasaka@chromium.org> wrote:
>
> The "only tabs for indentation" rule was enforced long ago to align with
> Linux kernel net coding style. This is no longer the case today so we
> are relaxing the coding style to allow spaces after tabs if it can
> increase readability.
>
> ---
>  doc/coding-style.txt | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/doc/coding-style.txt b/doc/coding-style.txt
> index f0bf880e3..6a7415847 100644
> --- a/doc/coding-style.txt
> +++ b/doc/coding-style.txt
> @@ -104,9 +104,16 @@ void btd_adapter_register_pin_cb(struct btd_adapter *adapter,
>  void btd_adapter_register_pin_cb(struct btd_adapter *adapter,
>                                                         btd_adapter_pin_cb_t cb)
>
> +5)
> +void btd_adapter_register_pin_cb(struct btd_adapter *adapter,
> +                                btd_adapter_pin_cb_t cb)
> +
>  The referred style for line wrapping is to indent as far as possible to the
>  right without hitting the 80 columns limit.
>
> +It is acceptable to add padding with spaces after tabs to increase
> +readability, for example to indent function arguments at the parenthesis.
> +

@Marcel: Any thoughts on this change? Id like to apply this so we make
the life of people contributing to both kernel and userspace easier.

>  M5: Space when doing type casting
>  =================================
>
> --
> 2.26.2
>


-- 
Luiz Augusto von Dentz

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH BlueZ] doc/coding-style: Allow spaces after tabs for indenting wrapped lines
  2020-09-16 23:29 [PATCH BlueZ] doc/coding-style: Allow spaces after tabs for indenting wrapped lines Sonny Sasaka
  2020-09-16 23:36 ` Luiz Augusto von Dentz
@ 2020-10-01  7:16 ` Marcel Holtmann
  2020-10-22 20:16   ` Sonny Sasaka
  1 sibling, 1 reply; 5+ messages in thread
From: Marcel Holtmann @ 2020-10-01  7:16 UTC (permalink / raw)
  To: Sonny Sasaka; +Cc: linux-bluetooth

Hi Sonny,

> The "only tabs for indentation" rule was enforced long ago to align with
> Linux kernel net coding style. This is no longer the case today so we
> are relaxing the coding style to allow spaces after tabs if it can
> increase readability.
> 
> ---
> doc/coding-style.txt | 7 +++++++
> 1 file changed, 7 insertions(+)
> 
> diff --git a/doc/coding-style.txt b/doc/coding-style.txt
> index f0bf880e3..6a7415847 100644
> --- a/doc/coding-style.txt
> +++ b/doc/coding-style.txt
> @@ -104,9 +104,16 @@ void btd_adapter_register_pin_cb(struct btd_adapter *adapter,
> void btd_adapter_register_pin_cb(struct btd_adapter *adapter,
> 							btd_adapter_pin_cb_t cb)
> 
> +5)
> +void btd_adapter_register_pin_cb(struct btd_adapter *adapter,
> +				 btd_adapter_pin_cb_t cb)
> +
> The referred style for line wrapping is to indent as far as possible to the
> right without hitting the 80 columns limit.
> 
> +It is acceptable to add padding with spaces after tabs to increase
> +readability, for example to indent function arguments at the parenthesis.
> +

NAK. The userspace style is a bit different than the kernel one.

Regards

Marcel


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH BlueZ] doc/coding-style: Allow spaces after tabs for indenting wrapped lines
  2020-10-01  7:16 ` Marcel Holtmann
@ 2020-10-22 20:16   ` Sonny Sasaka
  2020-11-09 13:01     ` Marcel Holtmann
  0 siblings, 1 reply; 5+ messages in thread
From: Sonny Sasaka @ 2020-10-22 20:16 UTC (permalink / raw)
  To: Marcel Holtmann, Luiz Augusto von Dentz; +Cc: linux-bluetooth

[Ping and resending in plain text]

Hi Marcel,

Could you share the reason behind the "only tab for indentation" rule
for userspace code? I find that it is hard to format the code and it'd
be good if we adopt the kernel space style indentation as well which
increases readability and ease of code formatting.


On Thu, Oct 1, 2020 at 12:16 AM Marcel Holtmann <marcel@holtmann.org> wrote:
>
> Hi Sonny,
>
> > The "only tabs for indentation" rule was enforced long ago to align with
> > Linux kernel net coding style. This is no longer the case today so we
> > are relaxing the coding style to allow spaces after tabs if it can
> > increase readability.
> >
> > ---
> > doc/coding-style.txt | 7 +++++++
> > 1 file changed, 7 insertions(+)
> >
> > diff --git a/doc/coding-style.txt b/doc/coding-style.txt
> > index f0bf880e3..6a7415847 100644
> > --- a/doc/coding-style.txt
> > +++ b/doc/coding-style.txt
> > @@ -104,9 +104,16 @@ void btd_adapter_register_pin_cb(struct btd_adapter *adapter,
> > void btd_adapter_register_pin_cb(struct btd_adapter *adapter,
> >                                                       btd_adapter_pin_cb_t cb)
> >
> > +5)
> > +void btd_adapter_register_pin_cb(struct btd_adapter *adapter,
> > +                              btd_adapter_pin_cb_t cb)
> > +
> > The referred style for line wrapping is to indent as far as possible to the
> > right without hitting the 80 columns limit.
> >
> > +It is acceptable to add padding with spaces after tabs to increase
> > +readability, for example to indent function arguments at the parenthesis.
> > +
>
> NAK. The userspace style is a bit different than the kernel one.
>
> Regards
>
> Marcel
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH BlueZ] doc/coding-style: Allow spaces after tabs for indenting wrapped lines
  2020-10-22 20:16   ` Sonny Sasaka
@ 2020-11-09 13:01     ` Marcel Holtmann
  0 siblings, 0 replies; 5+ messages in thread
From: Marcel Holtmann @ 2020-11-09 13:01 UTC (permalink / raw)
  To: Sonny Sasaka; +Cc: Luiz Augusto von Dentz, linux-bluetooth

Hi Sonny,

> Could you share the reason behind the "only tab for indentation" rule
> for userspace code? I find that it is hard to format the code and it'd
> be good if we adopt the kernel space style indentation as well which
> increases readability and ease of code formatting.

the coding style in BlueZ userspace is the original coding style that we
also keep in other projects like ConnMan, oFono, iwd, ELL etc. So I have no
interest in changing it.

Kernel patches use different coding style than userspace and that is fine.

Regards

Marcel


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-11-09 13:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-16 23:29 [PATCH BlueZ] doc/coding-style: Allow spaces after tabs for indenting wrapped lines Sonny Sasaka
2020-09-16 23:36 ` Luiz Augusto von Dentz
2020-10-01  7:16 ` Marcel Holtmann
2020-10-22 20:16   ` Sonny Sasaka
2020-11-09 13:01     ` Marcel Holtmann

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).