All of lore.kernel.org
 help / color / mirror / Atom feed
* PLEASE READ: Major change landing shortly (python whitespace)
@ 2012-07-18 10:06 Richard Purdie
  2012-07-18 10:17   ` Burton, Ross
                   ` (2 more replies)
  0 siblings, 3 replies; 24+ messages in thread
From: Richard Purdie @ 2012-07-18 10:06 UTC (permalink / raw)
  To: openembedded-core; +Cc: bitbake-devel

It's become clear we have a horrible mixture of whitespace (tabs and
space) in python functions. At first glance this sounds trivial but
there is a serious problem if pieces of code get mixed together with
different whitespace since they may or may not work as intended.

The documented standard for python functions is four space indentation
although we have a mixture. Fixing this sounds simple at first, we just
go through and change tabs to spaces. The problem comes with _append and
_prepend to python functions since both need their whitespace changed at
the same time. populate_packages() is the real problem child in that
regard but its the less common examples I worry about.

I did some research and we have inconsistencies, even in existing
functions since people are editing files and getting confused
(understandably).

So the question becomes, how do we get ourselves out of this mess?

I put a proposal to the TSC, that we have bitbake warn/error whenever it
finds tab characters in any python function. The advantage of this is
that we give the user a clear definitive error. The downside is that
we'll have to go through all the metadata and scrub it for the problem.

The TSC agrees we should do something about this rather than perpetuate
the problem and that this is as good a solution as any of us can come up
with. We also agreed that we should do it sooner than later before it
gets any later in this release cycle. Putting it off until the next
release cycle didn't seem to offer any advantage, we might as well get
on with it.

So I am going to:

a) Try and flush through as many pending patches as I can.
b) Check in a warning into bitbake master and increase its version
c) Require that version in OE-Core
d) Commit a significant set of whitespace changes to OE-Core, resolving
all the warnings for OE-Core.

I plan to do this, tomorrow, Thursday.

The reason for getting on with it is that the patches are horrible to
carry around and that any other patches made against OE-Core will likely
need to be remade to apply after these changes. I therefore don't want a
week of waiting around discussing it, this is something I believe we
need to do now and be done with it. I'm also not going to post the
whitespace patches for review, I'll write+merge them and then be
responsive for accepting fixes for anything that gets broken. They will
only be whitespace changes.

I appreciate this is going to cause some disruption but I think there is
a problem worth solving here and this is the best way to do it. If
anyone has any strong objections I'm open to alternative ideas.

The bitbake patch to error on tab whitespace is included below. I'll try
and post a branch with the whitespace fixes on later today.

Cheers,

Richard




diff --git a/bitbake/lib/bb/data.py b/bitbake/lib/bb/data.py
index e3ffefe..4b653a5 100644
--- a/bitbake/lib/bb/data.py
+++ b/bitbake/lib/bb/data.py
@@ -291,6 +291,8 @@ def build_dependencies(key, keys, shelldeps, vardepvals, d):
             if d.getVarFlag(key, "python"):
                 parsedvar = d.expandWithRefs(value, key)
                 parser = bb.codeparser.PythonParser(key, logger)
+                if parsedvar.value and "\t" in parsedvar.value:
+                    bb.warn("Variable %s contains tabs, please remove these" % key)
                 parser.parse_python(parsedvar.value)
                 deps = deps | parser.references
             else:
diff --git a/bitbake/lib/bb/parse/ast.py b/bitbake/lib/bb/parse/ast.py
index eae840f..86f9463 100644
--- a/bitbake/lib/bb/parse/ast.py
+++ b/bitbake/lib/bb/parse/ast.py
@@ -212,9 +212,9 @@ class ExportFuncsNode(AstNode):
                         data.setVarFlag(calledvar, flag, data.getVarFlag(var, flag))
 
                 if data.getVarFlag(calledvar, "python"):
-                    data.setVar(var, "\tbb.build.exec_func('" + calledvar + "', d)\n")
+                    data.setVar(var, "    bb.build.exec_func('" + calledvar + "', d)\n")
                 else:
-                    data.setVar(var, "\t" + calledvar + "\n")
+                    data.setVar(var, "    " + calledvar + "\n")
                 data.setVarFlag(var, 'export_func', '1')
 
 class AddTaskNode(AstNode):





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

* Re: [OE-core] PLEASE READ: Major change landing shortly (python whitespace)
  2012-07-18 10:06 PLEASE READ: Major change landing shortly (python whitespace) Richard Purdie
@ 2012-07-18 10:17   ` Burton, Ross
  2012-07-18 10:40   ` [bitbake-devel] " Martin Jansa
  2012-07-19 14:44 ` Jack Mitchell
  2 siblings, 0 replies; 24+ messages in thread
From: Burton, Ross @ 2012-07-18 10:17 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer; +Cc: bitbake-devel

On 18 July 2012 11:06, Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
> I put a proposal to the TSC, that we have bitbake warn/error whenever it
> finds tab characters in any python function. The advantage of this is
> that we give the user a clear definitive error. The downside is that
> we'll have to go through all the metadata and scrub it for the problem.

Have you ran that warning over oe-core to check that there are not any
legitimate uses of \t, not for indentation but inside strings?  I
can't think of any realistic use but you never know (construct a
Makefile in a python function?).

Ross



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

* Re: PLEASE READ: Major change landing shortly (python whitespace)
@ 2012-07-18 10:17   ` Burton, Ross
  0 siblings, 0 replies; 24+ messages in thread
From: Burton, Ross @ 2012-07-18 10:17 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer; +Cc: bitbake-devel

On 18 July 2012 11:06, Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
> I put a proposal to the TSC, that we have bitbake warn/error whenever it
> finds tab characters in any python function. The advantage of this is
> that we give the user a clear definitive error. The downside is that
> we'll have to go through all the metadata and scrub it for the problem.

Have you ran that warning over oe-core to check that there are not any
legitimate uses of \t, not for indentation but inside strings?  I
can't think of any realistic use but you never know (construct a
Makefile in a python function?).

Ross



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

* Re: PLEASE READ: Major change landing shortly (python whitespace)
  2012-07-18 10:06 PLEASE READ: Major change landing shortly (python whitespace) Richard Purdie
@ 2012-07-18 10:40   ` Martin Jansa
  2012-07-18 10:40   ` [bitbake-devel] " Martin Jansa
  2012-07-19 14:44 ` Jack Mitchell
  2 siblings, 0 replies; 24+ messages in thread
From: Martin Jansa @ 2012-07-18 10:40 UTC (permalink / raw)
  To: Richard Purdie; +Cc: bitbake-devel, openembedded-core

[-- Attachment #1: Type: text/plain, Size: 5002 bytes --]

On Wed, Jul 18, 2012 at 11:06:45AM +0100, Richard Purdie wrote:
> It's become clear we have a horrible mixture of whitespace (tabs and
> space) in python functions. At first glance this sounds trivial but
> there is a serious problem if pieces of code get mixed together with
> different whitespace since they may or may not work as intended.
> 
> The documented standard for python functions is four space indentation
> although we have a mixture. Fixing this sounds simple at first, we just
> go through and change tabs to spaces. The problem comes with _append and
> _prepend to python functions since both need their whitespace changed at
> the same time. populate_packages() is the real problem child in that
> regard but its the less common examples I worry about.
> 
> I did some research and we have inconsistencies, even in existing
> functions since people are editing files and getting confused
> (understandably).
> 
> So the question becomes, how do we get ourselves out of this mess?
> 
> I put a proposal to the TSC, that we have bitbake warn/error whenever it
> finds tab characters in any python function. The advantage of this is
> that we give the user a clear definitive error. The downside is that
> we'll have to go through all the metadata and scrub it for the problem.
> 
> The TSC agrees we should do something about this rather than perpetuate
> the problem and that this is as good a solution as any of us can come up
> with. We also agreed that we should do it sooner than later before it
> gets any later in this release cycle. Putting it off until the next
> release cycle didn't seem to offer any advantage, we might as well get
> on with it.
> 
> So I am going to:
> 
> a) Try and flush through as many pending patches as I can.
> b) Check in a warning into bitbake master and increase its version
> c) Require that version in OE-Core

Great.. this is usefull also for latest change from proto to protocol
param in fetcher, but please make sure that the svn.py patch I've sent
yesterday is also in before release..

> d) Commit a significant set of whitespace changes to OE-Core, resolving
> all the warnings for OE-Core.
> 
> I plan to do this, tomorrow, Thursday.
> 
> The reason for getting on with it is that the patches are horrible to
> carry around and that any other patches made against OE-Core will likely
> need to be remade to apply after these changes. I therefore don't want a
> week of waiting around discussing it, this is something I believe we
> need to do now and be done with it. I'm also not going to post the
> whitespace patches for review, I'll write+merge them and then be
> responsive for accepting fixes for anything that gets broken. They will
> only be whitespace changes.
> 
> I appreciate this is going to cause some disruption but I think there is
> a problem worth solving here and this is the best way to do it. If
> anyone has any strong objections I'm open to alternative ideas.
> 
> The bitbake patch to error on tab whitespace is included below. I'll try
> and post a branch with the whitespace fixes on later today.
> 
> Cheers,
> 
> Richard
> 
> 
> 
> 
> diff --git a/bitbake/lib/bb/data.py b/bitbake/lib/bb/data.py
> index e3ffefe..4b653a5 100644
> --- a/bitbake/lib/bb/data.py
> +++ b/bitbake/lib/bb/data.py
> @@ -291,6 +291,8 @@ def build_dependencies(key, keys, shelldeps, vardepvals, d):
>              if d.getVarFlag(key, "python"):
>                  parsedvar = d.expandWithRefs(value, key)
>                  parser = bb.codeparser.PythonParser(key, logger)
> +                if parsedvar.value and "\t" in parsedvar.value:
> +                    bb.warn("Variable %s contains tabs, please remove these" % key)
>                  parser.parse_python(parsedvar.value)
>                  deps = deps | parser.references
>              else:
> diff --git a/bitbake/lib/bb/parse/ast.py b/bitbake/lib/bb/parse/ast.py
> index eae840f..86f9463 100644
> --- a/bitbake/lib/bb/parse/ast.py
> +++ b/bitbake/lib/bb/parse/ast.py
> @@ -212,9 +212,9 @@ class ExportFuncsNode(AstNode):
>                          data.setVarFlag(calledvar, flag, data.getVarFlag(var, flag))
>  
>                  if data.getVarFlag(calledvar, "python"):
> -                    data.setVar(var, "\tbb.build.exec_func('" + calledvar + "', d)\n")
> +                    data.setVar(var, "    bb.build.exec_func('" + calledvar + "', d)\n")
>                  else:
> -                    data.setVar(var, "\t" + calledvar + "\n")
> +                    data.setVar(var, "    " + calledvar + "\n")
>                  data.setVarFlag(var, 'export_func', '1')
>  
>  class AddTaskNode(AstNode):
> 
> 
> 
> _______________________________________________
> bitbake-devel mailing list
> bitbake-devel@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/bitbake-devel

-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 205 bytes --]

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

* Re: [bitbake-devel] PLEASE READ: Major change landing shortly (python whitespace)
@ 2012-07-18 10:40   ` Martin Jansa
  0 siblings, 0 replies; 24+ messages in thread
From: Martin Jansa @ 2012-07-18 10:40 UTC (permalink / raw)
  To: Richard Purdie; +Cc: bitbake-devel, openembedded-core

[-- Attachment #1: Type: text/plain, Size: 5002 bytes --]

On Wed, Jul 18, 2012 at 11:06:45AM +0100, Richard Purdie wrote:
> It's become clear we have a horrible mixture of whitespace (tabs and
> space) in python functions. At first glance this sounds trivial but
> there is a serious problem if pieces of code get mixed together with
> different whitespace since they may or may not work as intended.
> 
> The documented standard for python functions is four space indentation
> although we have a mixture. Fixing this sounds simple at first, we just
> go through and change tabs to spaces. The problem comes with _append and
> _prepend to python functions since both need their whitespace changed at
> the same time. populate_packages() is the real problem child in that
> regard but its the less common examples I worry about.
> 
> I did some research and we have inconsistencies, even in existing
> functions since people are editing files and getting confused
> (understandably).
> 
> So the question becomes, how do we get ourselves out of this mess?
> 
> I put a proposal to the TSC, that we have bitbake warn/error whenever it
> finds tab characters in any python function. The advantage of this is
> that we give the user a clear definitive error. The downside is that
> we'll have to go through all the metadata and scrub it for the problem.
> 
> The TSC agrees we should do something about this rather than perpetuate
> the problem and that this is as good a solution as any of us can come up
> with. We also agreed that we should do it sooner than later before it
> gets any later in this release cycle. Putting it off until the next
> release cycle didn't seem to offer any advantage, we might as well get
> on with it.
> 
> So I am going to:
> 
> a) Try and flush through as many pending patches as I can.
> b) Check in a warning into bitbake master and increase its version
> c) Require that version in OE-Core

Great.. this is usefull also for latest change from proto to protocol
param in fetcher, but please make sure that the svn.py patch I've sent
yesterday is also in before release..

> d) Commit a significant set of whitespace changes to OE-Core, resolving
> all the warnings for OE-Core.
> 
> I plan to do this, tomorrow, Thursday.
> 
> The reason for getting on with it is that the patches are horrible to
> carry around and that any other patches made against OE-Core will likely
> need to be remade to apply after these changes. I therefore don't want a
> week of waiting around discussing it, this is something I believe we
> need to do now and be done with it. I'm also not going to post the
> whitespace patches for review, I'll write+merge them and then be
> responsive for accepting fixes for anything that gets broken. They will
> only be whitespace changes.
> 
> I appreciate this is going to cause some disruption but I think there is
> a problem worth solving here and this is the best way to do it. If
> anyone has any strong objections I'm open to alternative ideas.
> 
> The bitbake patch to error on tab whitespace is included below. I'll try
> and post a branch with the whitespace fixes on later today.
> 
> Cheers,
> 
> Richard
> 
> 
> 
> 
> diff --git a/bitbake/lib/bb/data.py b/bitbake/lib/bb/data.py
> index e3ffefe..4b653a5 100644
> --- a/bitbake/lib/bb/data.py
> +++ b/bitbake/lib/bb/data.py
> @@ -291,6 +291,8 @@ def build_dependencies(key, keys, shelldeps, vardepvals, d):
>              if d.getVarFlag(key, "python"):
>                  parsedvar = d.expandWithRefs(value, key)
>                  parser = bb.codeparser.PythonParser(key, logger)
> +                if parsedvar.value and "\t" in parsedvar.value:
> +                    bb.warn("Variable %s contains tabs, please remove these" % key)
>                  parser.parse_python(parsedvar.value)
>                  deps = deps | parser.references
>              else:
> diff --git a/bitbake/lib/bb/parse/ast.py b/bitbake/lib/bb/parse/ast.py
> index eae840f..86f9463 100644
> --- a/bitbake/lib/bb/parse/ast.py
> +++ b/bitbake/lib/bb/parse/ast.py
> @@ -212,9 +212,9 @@ class ExportFuncsNode(AstNode):
>                          data.setVarFlag(calledvar, flag, data.getVarFlag(var, flag))
>  
>                  if data.getVarFlag(calledvar, "python"):
> -                    data.setVar(var, "\tbb.build.exec_func('" + calledvar + "', d)\n")
> +                    data.setVar(var, "    bb.build.exec_func('" + calledvar + "', d)\n")
>                  else:
> -                    data.setVar(var, "\t" + calledvar + "\n")
> +                    data.setVar(var, "    " + calledvar + "\n")
>                  data.setVarFlag(var, 'export_func', '1')
>  
>  class AddTaskNode(AstNode):
> 
> 
> 
> _______________________________________________
> bitbake-devel mailing list
> bitbake-devel@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/bitbake-devel

-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 205 bytes --]

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

* Re: [OE-core] PLEASE READ: Major change landing shortly (python whitespace)
  2012-07-18 10:17   ` Burton, Ross
@ 2012-07-18 11:40     ` Richard Purdie
  -1 siblings, 0 replies; 24+ messages in thread
From: Richard Purdie @ 2012-07-18 11:40 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer; +Cc: bitbake-devel

On Wed, 2012-07-18 at 11:17 +0100, Burton, Ross wrote:
> On 18 July 2012 11:06, Richard Purdie
> <richard.purdie@linuxfoundation.org> wrote:
> > I put a proposal to the TSC, that we have bitbake warn/error whenever it
> > finds tab characters in any python function. The advantage of this is
> > that we give the user a clear definitive error. The downside is that
> > we'll have to go through all the metadata and scrub it for the problem.
> 
> Have you ran that warning over oe-core to check that there are not any
> legitimate uses of \t, not for indentation but inside strings?  I
> can't think of any realistic use but you never know (construct a
> Makefile in a python function?).

The check is for actual tab characters, not "\t". There are some
legitimate users of tab characters which I've replaced with \t in
strings.

My current patch work in progress for the conversion is:

http://git.yoctoproject.org/cgit.cgi/poky-contrib/commit/?h=rpurdie/t14&id=49d3d01f3d61a0eb19b6852229fa8fc26712f653

Cheers,

Richard






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

* Re: PLEASE READ: Major change landing shortly (python whitespace)
@ 2012-07-18 11:40     ` Richard Purdie
  0 siblings, 0 replies; 24+ messages in thread
From: Richard Purdie @ 2012-07-18 11:40 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer; +Cc: bitbake-devel

On Wed, 2012-07-18 at 11:17 +0100, Burton, Ross wrote:
> On 18 July 2012 11:06, Richard Purdie
> <richard.purdie@linuxfoundation.org> wrote:
> > I put a proposal to the TSC, that we have bitbake warn/error whenever it
> > finds tab characters in any python function. The advantage of this is
> > that we give the user a clear definitive error. The downside is that
> > we'll have to go through all the metadata and scrub it for the problem.
> 
> Have you ran that warning over oe-core to check that there are not any
> legitimate uses of \t, not for indentation but inside strings?  I
> can't think of any realistic use but you never know (construct a
> Makefile in a python function?).

The check is for actual tab characters, not "\t". There are some
legitimate users of tab characters which I've replaced with \t in
strings.

My current patch work in progress for the conversion is:

http://git.yoctoproject.org/cgit.cgi/poky-contrib/commit/?h=rpurdie/t14&id=49d3d01f3d61a0eb19b6852229fa8fc26712f653

Cheers,

Richard






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

* Re: PLEASE READ: Major change landing shortly (python whitespace)
  2012-07-18 10:40   ` [bitbake-devel] " Martin Jansa
@ 2012-07-18 13:11     ` Richard Purdie
  -1 siblings, 0 replies; 24+ messages in thread
From: Richard Purdie @ 2012-07-18 13:11 UTC (permalink / raw)
  To: Martin Jansa; +Cc: bitbake-devel, openembedded-core

On Wed, 2012-07-18 at 12:40 +0200, Martin Jansa wrote:
> On Wed, Jul 18, 2012 at 11:06:45AM +0100, Richard Purdie wrote:
> > It's become clear we have a horrible mixture of whitespace (tabs and
> > space) in python functions. At first glance this sounds trivial but
> > there is a serious problem if pieces of code get mixed together with
> > different whitespace since they may or may not work as intended.
> > 
> > The documented standard for python functions is four space indentation
> > although we have a mixture. Fixing this sounds simple at first, we just
> > go through and change tabs to spaces. The problem comes with _append and
> > _prepend to python functions since both need their whitespace changed at
> > the same time. populate_packages() is the real problem child in that
> > regard but its the less common examples I worry about.
> > 
> > I did some research and we have inconsistencies, even in existing
> > functions since people are editing files and getting confused
> > (understandably).
> > 
> > So the question becomes, how do we get ourselves out of this mess?
> > 
> > I put a proposal to the TSC, that we have bitbake warn/error whenever it
> > finds tab characters in any python function. The advantage of this is
> > that we give the user a clear definitive error. The downside is that
> > we'll have to go through all the metadata and scrub it for the problem.
> > 
> > The TSC agrees we should do something about this rather than perpetuate
> > the problem and that this is as good a solution as any of us can come up
> > with. We also agreed that we should do it sooner than later before it
> > gets any later in this release cycle. Putting it off until the next
> > release cycle didn't seem to offer any advantage, we might as well get
> > on with it.
> > 
> > So I am going to:
> > 
> > a) Try and flush through as many pending patches as I can.
> > b) Check in a warning into bitbake master and increase its version
> > c) Require that version in OE-Core
> 
> Great.. this is usefull also for latest change from proto to protocol
> param in fetcher, but please make sure that the svn.py patch I've sent
> yesterday is also in before release..

I was aware of this issue too which was at the back of my mind when I
proposed this. The svn patch is in now.

Cheers,

Richard




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

* Re: [bitbake-devel] PLEASE READ: Major change landing shortly (python whitespace)
@ 2012-07-18 13:11     ` Richard Purdie
  0 siblings, 0 replies; 24+ messages in thread
From: Richard Purdie @ 2012-07-18 13:11 UTC (permalink / raw)
  To: Martin Jansa; +Cc: bitbake-devel, openembedded-core

On Wed, 2012-07-18 at 12:40 +0200, Martin Jansa wrote:
> On Wed, Jul 18, 2012 at 11:06:45AM +0100, Richard Purdie wrote:
> > It's become clear we have a horrible mixture of whitespace (tabs and
> > space) in python functions. At first glance this sounds trivial but
> > there is a serious problem if pieces of code get mixed together with
> > different whitespace since they may or may not work as intended.
> > 
> > The documented standard for python functions is four space indentation
> > although we have a mixture. Fixing this sounds simple at first, we just
> > go through and change tabs to spaces. The problem comes with _append and
> > _prepend to python functions since both need their whitespace changed at
> > the same time. populate_packages() is the real problem child in that
> > regard but its the less common examples I worry about.
> > 
> > I did some research and we have inconsistencies, even in existing
> > functions since people are editing files and getting confused
> > (understandably).
> > 
> > So the question becomes, how do we get ourselves out of this mess?
> > 
> > I put a proposal to the TSC, that we have bitbake warn/error whenever it
> > finds tab characters in any python function. The advantage of this is
> > that we give the user a clear definitive error. The downside is that
> > we'll have to go through all the metadata and scrub it for the problem.
> > 
> > The TSC agrees we should do something about this rather than perpetuate
> > the problem and that this is as good a solution as any of us can come up
> > with. We also agreed that we should do it sooner than later before it
> > gets any later in this release cycle. Putting it off until the next
> > release cycle didn't seem to offer any advantage, we might as well get
> > on with it.
> > 
> > So I am going to:
> > 
> > a) Try and flush through as many pending patches as I can.
> > b) Check in a warning into bitbake master and increase its version
> > c) Require that version in OE-Core
> 
> Great.. this is usefull also for latest change from proto to protocol
> param in fetcher, but please make sure that the svn.py patch I've sent
> yesterday is also in before release..

I was aware of this issue too which was at the back of my mind when I
proposed this. The svn patch is in now.

Cheers,

Richard




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

* Re: [OE-core] PLEASE READ: Major change landing shortly (python whitespace)
  2012-07-18 11:40     ` Richard Purdie
@ 2012-07-18 21:43       ` Martin Jansa
  -1 siblings, 0 replies; 24+ messages in thread
From: Martin Jansa @ 2012-07-18 21:43 UTC (permalink / raw)
  To: Richard Purdie
  Cc: bitbake-devel, Patches and discussions about the oe-core layer

[-- Attachment #1: Type: text/plain, Size: 1452 bytes --]

On Wed, Jul 18, 2012 at 12:40:18PM +0100, Richard Purdie wrote:
> On Wed, 2012-07-18 at 11:17 +0100, Burton, Ross wrote:
> > On 18 July 2012 11:06, Richard Purdie
> > <richard.purdie@linuxfoundation.org> wrote:
> > > I put a proposal to the TSC, that we have bitbake warn/error whenever it
> > > finds tab characters in any python function. The advantage of this is
> > > that we give the user a clear definitive error. The downside is that
> > > we'll have to go through all the metadata and scrub it for the problem.
> > 
> > Have you ran that warning over oe-core to check that there are not any
> > legitimate uses of \t, not for indentation but inside strings?  I
> > can't think of any realistic use but you never know (construct a
> > Makefile in a python function?).
> 
> The check is for actual tab characters, not "\t". There are some
> legitimate users of tab characters which I've replaced with \t in
> strings.
> 
> My current patch work in progress for the conversion is:
> 
> http://git.yoctoproject.org/cgit.cgi/poky-contrib/commit/?h=rpurdie/t14&id=49d3d01f3d61a0eb19b6852229fa8fc26712f653

Would be great if someone updates

bitbake/contrib/vim to highlight tabs, so that every tab would be easily
spotted in recipe/bbclass.

And maybe also meta-openembedded/contrib/oe-stylize.py, but that seems
to expand tabs to spaces already.

Cheers,

-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 205 bytes --]

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

* Re: [bitbake-devel] PLEASE READ: Major change landing shortly (python whitespace)
@ 2012-07-18 21:43       ` Martin Jansa
  0 siblings, 0 replies; 24+ messages in thread
From: Martin Jansa @ 2012-07-18 21:43 UTC (permalink / raw)
  To: Richard Purdie
  Cc: bitbake-devel, Patches and discussions about the oe-core layer

[-- Attachment #1: Type: text/plain, Size: 1452 bytes --]

On Wed, Jul 18, 2012 at 12:40:18PM +0100, Richard Purdie wrote:
> On Wed, 2012-07-18 at 11:17 +0100, Burton, Ross wrote:
> > On 18 July 2012 11:06, Richard Purdie
> > <richard.purdie@linuxfoundation.org> wrote:
> > > I put a proposal to the TSC, that we have bitbake warn/error whenever it
> > > finds tab characters in any python function. The advantage of this is
> > > that we give the user a clear definitive error. The downside is that
> > > we'll have to go through all the metadata and scrub it for the problem.
> > 
> > Have you ran that warning over oe-core to check that there are not any
> > legitimate uses of \t, not for indentation but inside strings?  I
> > can't think of any realistic use but you never know (construct a
> > Makefile in a python function?).
> 
> The check is for actual tab characters, not "\t". There are some
> legitimate users of tab characters which I've replaced with \t in
> strings.
> 
> My current patch work in progress for the conversion is:
> 
> http://git.yoctoproject.org/cgit.cgi/poky-contrib/commit/?h=rpurdie/t14&id=49d3d01f3d61a0eb19b6852229fa8fc26712f653

Would be great if someone updates

bitbake/contrib/vim to highlight tabs, so that every tab would be easily
spotted in recipe/bbclass.

And maybe also meta-openembedded/contrib/oe-stylize.py, but that seems
to expand tabs to spaces already.

Cheers,

-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 205 bytes --]

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

* Re: [OE-core] PLEASE READ: Major change landing shortly (python whitespace)
  2012-07-18 21:43       ` [bitbake-devel] " Martin Jansa
@ 2012-07-19  8:26         ` Henning Heinold
  -1 siblings, 0 replies; 24+ messages in thread
From: Henning Heinold @ 2012-07-19  8:26 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer; +Cc: bitbake-devel

On Wed, Jul 18, 2012 at 11:43:58PM +0200, Martin Jansa wrote:
> On Wed, Jul 18, 2012 at 12:40:18PM +0100, Richard Purdie wrote:
> > On Wed, 2012-07-18 at 11:17 +0100, Burton, Ross wrote:
> > > On 18 July 2012 11:06, Richard Purdie
> > > <richard.purdie@linuxfoundation.org> wrote:
> > > > I put a proposal to the TSC, that we have bitbake warn/error whenever it
> > > > finds tab characters in any python function. The advantage of this is
> > > > that we give the user a clear definitive error. The downside is that
> > > > we'll have to go through all the metadata and scrub it for the problem.
> > > 
> > > Have you ran that warning over oe-core to check that there are not any
> > > legitimate uses of \t, not for indentation but inside strings?  I
> > > can't think of any realistic use but you never know (construct a
> > > Makefile in a python function?).
> > 
> > The check is for actual tab characters, not "\t". There are some
> > legitimate users of tab characters which I've replaced with \t in
> > strings.
> > 
> > My current patch work in progress for the conversion is:
> > 
> > http://git.yoctoproject.org/cgit.cgi/poky-contrib/commit/?h=rpurdie/t14&id=49d3d01f3d61a0eb19b6852229fa8fc26712f653
> 
> Would be great if someone updates
> 
> bitbake/contrib/vim to highlight tabs, so that every tab would be easily
> spotted in recipe/bbclass.
> 
> And maybe also meta-openembedded/contrib/oe-stylize.py, but that seems
> to expand tabs to spaces already.
> 
> Cheers,
> 
> -- 
> Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com

Hi,

should we enable the vim unwanted spaces/tabs higlighting too?

Bye Henning



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

* Re: [bitbake-devel] PLEASE READ: Major change landing shortly (python whitespace)
@ 2012-07-19  8:26         ` Henning Heinold
  0 siblings, 0 replies; 24+ messages in thread
From: Henning Heinold @ 2012-07-19  8:26 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer; +Cc: bitbake-devel

On Wed, Jul 18, 2012 at 11:43:58PM +0200, Martin Jansa wrote:
> On Wed, Jul 18, 2012 at 12:40:18PM +0100, Richard Purdie wrote:
> > On Wed, 2012-07-18 at 11:17 +0100, Burton, Ross wrote:
> > > On 18 July 2012 11:06, Richard Purdie
> > > <richard.purdie@linuxfoundation.org> wrote:
> > > > I put a proposal to the TSC, that we have bitbake warn/error whenever it
> > > > finds tab characters in any python function. The advantage of this is
> > > > that we give the user a clear definitive error. The downside is that
> > > > we'll have to go through all the metadata and scrub it for the problem.
> > > 
> > > Have you ran that warning over oe-core to check that there are not any
> > > legitimate uses of \t, not for indentation but inside strings?  I
> > > can't think of any realistic use but you never know (construct a
> > > Makefile in a python function?).
> > 
> > The check is for actual tab characters, not "\t". There are some
> > legitimate users of tab characters which I've replaced with \t in
> > strings.
> > 
> > My current patch work in progress for the conversion is:
> > 
> > http://git.yoctoproject.org/cgit.cgi/poky-contrib/commit/?h=rpurdie/t14&id=49d3d01f3d61a0eb19b6852229fa8fc26712f653
> 
> Would be great if someone updates
> 
> bitbake/contrib/vim to highlight tabs, so that every tab would be easily
> spotted in recipe/bbclass.
> 
> And maybe also meta-openembedded/contrib/oe-stylize.py, but that seems
> to expand tabs to spaces already.
> 
> Cheers,
> 
> -- 
> Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com

Hi,

should we enable the vim unwanted spaces/tabs higlighting too?

Bye Henning



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

* Re: [OE-core] PLEASE READ: Major change landing shortly (python whitespace)
  2012-07-18 11:40     ` Richard Purdie
@ 2012-07-19  9:49       ` Martin Jansa
  -1 siblings, 0 replies; 24+ messages in thread
From: Martin Jansa @ 2012-07-19  9:49 UTC (permalink / raw)
  To: Richard Purdie
  Cc: bitbake-devel, Patches and discussions about the oe-core layer

[-- Attachment #1: Type: text/plain, Size: 1384 bytes --]

On Wed, Jul 18, 2012 at 12:40:18PM +0100, Richard Purdie wrote:
> On Wed, 2012-07-18 at 11:17 +0100, Burton, Ross wrote:
> > On 18 July 2012 11:06, Richard Purdie
> > <richard.purdie@linuxfoundation.org> wrote:
> > > I put a proposal to the TSC, that we have bitbake warn/error whenever it
> > > finds tab characters in any python function. The advantage of this is
> > > that we give the user a clear definitive error. The downside is that
> > > we'll have to go through all the metadata and scrub it for the problem.
> > 
> > Have you ran that warning over oe-core to check that there are not any
> > legitimate uses of \t, not for indentation but inside strings?  I
> > can't think of any realistic use but you never know (construct a
> > Makefile in a python function?).
> 
> The check is for actual tab characters, not "\t". There are some
> legitimate users of tab characters which I've replaced with \t in
> strings.
> 
> My current patch work in progress for the conversion is:
> 
> http://git.yoctoproject.org/cgit.cgi/poky-contrib/commit/?h=rpurdie/t14&id=49d3d01f3d61a0eb19b6852229fa8fc26712f653

from those 2 patches which were just merged I see that you're converting
strictly python functions, can we extend this tabs->spaces rule also to
bash tasks like do_install etc?

Cheers,

-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 205 bytes --]

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

* Re: [bitbake-devel] PLEASE READ: Major change landing shortly (python whitespace)
@ 2012-07-19  9:49       ` Martin Jansa
  0 siblings, 0 replies; 24+ messages in thread
From: Martin Jansa @ 2012-07-19  9:49 UTC (permalink / raw)
  To: Richard Purdie
  Cc: bitbake-devel, Patches and discussions about the oe-core layer

[-- Attachment #1: Type: text/plain, Size: 1384 bytes --]

On Wed, Jul 18, 2012 at 12:40:18PM +0100, Richard Purdie wrote:
> On Wed, 2012-07-18 at 11:17 +0100, Burton, Ross wrote:
> > On 18 July 2012 11:06, Richard Purdie
> > <richard.purdie@linuxfoundation.org> wrote:
> > > I put a proposal to the TSC, that we have bitbake warn/error whenever it
> > > finds tab characters in any python function. The advantage of this is
> > > that we give the user a clear definitive error. The downside is that
> > > we'll have to go through all the metadata and scrub it for the problem.
> > 
> > Have you ran that warning over oe-core to check that there are not any
> > legitimate uses of \t, not for indentation but inside strings?  I
> > can't think of any realistic use but you never know (construct a
> > Makefile in a python function?).
> 
> The check is for actual tab characters, not "\t". There are some
> legitimate users of tab characters which I've replaced with \t in
> strings.
> 
> My current patch work in progress for the conversion is:
> 
> http://git.yoctoproject.org/cgit.cgi/poky-contrib/commit/?h=rpurdie/t14&id=49d3d01f3d61a0eb19b6852229fa8fc26712f653

from those 2 patches which were just merged I see that you're converting
strictly python functions, can we extend this tabs->spaces rule also to
bash tasks like do_install etc?

Cheers,

-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 205 bytes --]

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

* Re: [OE-core] PLEASE READ: Major change landing shortly (python whitespace)
  2012-07-19  9:49       ` [bitbake-devel] " Martin Jansa
@ 2012-07-19 10:15         ` Richard Purdie
  -1 siblings, 0 replies; 24+ messages in thread
From: Richard Purdie @ 2012-07-19 10:15 UTC (permalink / raw)
  To: Martin Jansa
  Cc: bitbake-devel, Patches and discussions about the oe-core layer

On Thu, 2012-07-19 at 11:49 +0200, Martin Jansa wrote:
> On Wed, Jul 18, 2012 at 12:40:18PM +0100, Richard Purdie wrote:
> > On Wed, 2012-07-18 at 11:17 +0100, Burton, Ross wrote:
> > > On 18 July 2012 11:06, Richard Purdie
> > > <richard.purdie@linuxfoundation.org> wrote:
> > > > I put a proposal to the TSC, that we have bitbake warn/error whenever it
> > > > finds tab characters in any python function. The advantage of this is
> > > > that we give the user a clear definitive error. The downside is that
> > > > we'll have to go through all the metadata and scrub it for the problem.
> > > 
> > > Have you ran that warning over oe-core to check that there are not any
> > > legitimate uses of \t, not for indentation but inside strings?  I
> > > can't think of any realistic use but you never know (construct a
> > > Makefile in a python function?).
> > 
> > The check is for actual tab characters, not "\t". There are some
> > legitimate users of tab characters which I've replaced with \t in
> > strings.
> > 
> > My current patch work in progress for the conversion is:
> > 
> > http://git.yoctoproject.org/cgit.cgi/poky-contrib/commit/?h=rpurdie/t14&id=49d3d01f3d61a0eb19b6852229fa8fc26712f653
> 
> from those 2 patches which were just merged I see that you're converting
> strictly python functions, can we extend this tabs->spaces rule also to
> bash tasks like do_install etc?

Shell tasks should be tabs according to the style guide. Its harder to
check the indentation in those and if the indentation is wrong, it
doesn't matter since they're not whitespace sensitive.

So whilst I'd welcome fixing them up, I don't think they need bitbake
enforcing policy in the same way as python functions.

Cheers,

Richard




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

* Re: [bitbake-devel] PLEASE READ: Major change landing shortly (python whitespace)
@ 2012-07-19 10:15         ` Richard Purdie
  0 siblings, 0 replies; 24+ messages in thread
From: Richard Purdie @ 2012-07-19 10:15 UTC (permalink / raw)
  To: Martin Jansa
  Cc: bitbake-devel, Patches and discussions about the oe-core layer

On Thu, 2012-07-19 at 11:49 +0200, Martin Jansa wrote:
> On Wed, Jul 18, 2012 at 12:40:18PM +0100, Richard Purdie wrote:
> > On Wed, 2012-07-18 at 11:17 +0100, Burton, Ross wrote:
> > > On 18 July 2012 11:06, Richard Purdie
> > > <richard.purdie@linuxfoundation.org> wrote:
> > > > I put a proposal to the TSC, that we have bitbake warn/error whenever it
> > > > finds tab characters in any python function. The advantage of this is
> > > > that we give the user a clear definitive error. The downside is that
> > > > we'll have to go through all the metadata and scrub it for the problem.
> > > 
> > > Have you ran that warning over oe-core to check that there are not any
> > > legitimate uses of \t, not for indentation but inside strings?  I
> > > can't think of any realistic use but you never know (construct a
> > > Makefile in a python function?).
> > 
> > The check is for actual tab characters, not "\t". There are some
> > legitimate users of tab characters which I've replaced with \t in
> > strings.
> > 
> > My current patch work in progress for the conversion is:
> > 
> > http://git.yoctoproject.org/cgit.cgi/poky-contrib/commit/?h=rpurdie/t14&id=49d3d01f3d61a0eb19b6852229fa8fc26712f653
> 
> from those 2 patches which were just merged I see that you're converting
> strictly python functions, can we extend this tabs->spaces rule also to
> bash tasks like do_install etc?

Shell tasks should be tabs according to the style guide. Its harder to
check the indentation in those and if the indentation is wrong, it
doesn't matter since they're not whitespace sensitive.

So whilst I'd welcome fixing them up, I don't think they need bitbake
enforcing policy in the same way as python functions.

Cheers,

Richard




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

* Re: [OE-core] PLEASE READ: Major change landing shortly (python whitespace)
  2012-07-19 10:15         ` [bitbake-devel] " Richard Purdie
@ 2012-07-19 11:18           ` Martin Jansa
  -1 siblings, 0 replies; 24+ messages in thread
From: Martin Jansa @ 2012-07-19 11:18 UTC (permalink / raw)
  To: Richard Purdie
  Cc: bitbake-devel, Patches and discussions about the oe-core layer

[-- Attachment #1: Type: text/plain, Size: 2396 bytes --]

On Thu, Jul 19, 2012 at 11:15:48AM +0100, Richard Purdie wrote:
> On Thu, 2012-07-19 at 11:49 +0200, Martin Jansa wrote:
> > On Wed, Jul 18, 2012 at 12:40:18PM +0100, Richard Purdie wrote:
> > > On Wed, 2012-07-18 at 11:17 +0100, Burton, Ross wrote:
> > > > On 18 July 2012 11:06, Richard Purdie
> > > > <richard.purdie@linuxfoundation.org> wrote:
> > > > > I put a proposal to the TSC, that we have bitbake warn/error whenever it
> > > > > finds tab characters in any python function. The advantage of this is
> > > > > that we give the user a clear definitive error. The downside is that
> > > > > we'll have to go through all the metadata and scrub it for the problem.
> > > > 
> > > > Have you ran that warning over oe-core to check that there are not any
> > > > legitimate uses of \t, not for indentation but inside strings?  I
> > > > can't think of any realistic use but you never know (construct a
> > > > Makefile in a python function?).
> > > 
> > > The check is for actual tab characters, not "\t". There are some
> > > legitimate users of tab characters which I've replaced with \t in
> > > strings.
> > > 
> > > My current patch work in progress for the conversion is:
> > > 
> > > http://git.yoctoproject.org/cgit.cgi/poky-contrib/commit/?h=rpurdie/t14&id=49d3d01f3d61a0eb19b6852229fa8fc26712f653
> > 
> > from those 2 patches which were just merged I see that you're converting
> > strictly python functions, can we extend this tabs->spaces rule also to
> > bash tasks like do_install etc?
> 
> Shell tasks should be tabs according to the style guide. Its harder to
> check the indentation in those and if the indentation is wrong, it
> doesn't matter since they're not whitespace sensitive.
> 
> So whilst I'd welcome fixing them up, I don't think they need bitbake
> enforcing policy in the same way as python functions.

Agreed about not forcing the check or updating all .bb/.inc files with
this now, but maybe style guide should be updated now?

I really don't like files with mixed indentation (even when it doesn't
hurt) especially with a lot of files not conforming to style guide now,
using even mix of tabs/spaces on the same line..

FWIW: I've prepared patch for whole meta-smartphone to unify that and
I've sent RFC for few bbclasses in meta-oe too.

Cheers,

-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 205 bytes --]

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

* Re: [bitbake-devel] PLEASE READ: Major change landing shortly (python whitespace)
@ 2012-07-19 11:18           ` Martin Jansa
  0 siblings, 0 replies; 24+ messages in thread
From: Martin Jansa @ 2012-07-19 11:18 UTC (permalink / raw)
  To: Richard Purdie
  Cc: bitbake-devel, Patches and discussions about the oe-core layer

[-- Attachment #1: Type: text/plain, Size: 2396 bytes --]

On Thu, Jul 19, 2012 at 11:15:48AM +0100, Richard Purdie wrote:
> On Thu, 2012-07-19 at 11:49 +0200, Martin Jansa wrote:
> > On Wed, Jul 18, 2012 at 12:40:18PM +0100, Richard Purdie wrote:
> > > On Wed, 2012-07-18 at 11:17 +0100, Burton, Ross wrote:
> > > > On 18 July 2012 11:06, Richard Purdie
> > > > <richard.purdie@linuxfoundation.org> wrote:
> > > > > I put a proposal to the TSC, that we have bitbake warn/error whenever it
> > > > > finds tab characters in any python function. The advantage of this is
> > > > > that we give the user a clear definitive error. The downside is that
> > > > > we'll have to go through all the metadata and scrub it for the problem.
> > > > 
> > > > Have you ran that warning over oe-core to check that there are not any
> > > > legitimate uses of \t, not for indentation but inside strings?  I
> > > > can't think of any realistic use but you never know (construct a
> > > > Makefile in a python function?).
> > > 
> > > The check is for actual tab characters, not "\t". There are some
> > > legitimate users of tab characters which I've replaced with \t in
> > > strings.
> > > 
> > > My current patch work in progress for the conversion is:
> > > 
> > > http://git.yoctoproject.org/cgit.cgi/poky-contrib/commit/?h=rpurdie/t14&id=49d3d01f3d61a0eb19b6852229fa8fc26712f653
> > 
> > from those 2 patches which were just merged I see that you're converting
> > strictly python functions, can we extend this tabs->spaces rule also to
> > bash tasks like do_install etc?
> 
> Shell tasks should be tabs according to the style guide. Its harder to
> check the indentation in those and if the indentation is wrong, it
> doesn't matter since they're not whitespace sensitive.
> 
> So whilst I'd welcome fixing them up, I don't think they need bitbake
> enforcing policy in the same way as python functions.

Agreed about not forcing the check or updating all .bb/.inc files with
this now, but maybe style guide should be updated now?

I really don't like files with mixed indentation (even when it doesn't
hurt) especially with a lot of files not conforming to style guide now,
using even mix of tabs/spaces on the same line..

FWIW: I've prepared patch for whole meta-smartphone to unify that and
I've sent RFC for few bbclasses in meta-oe too.

Cheers,

-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 205 bytes --]

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

* Re: [OE-core] PLEASE READ: Major change landing shortly (python whitespace)
  2012-07-19 11:18           ` [bitbake-devel] " Martin Jansa
@ 2012-07-19 11:27             ` Martin Jansa
  -1 siblings, 0 replies; 24+ messages in thread
From: Martin Jansa @ 2012-07-19 11:27 UTC (permalink / raw)
  To: Richard Purdie
  Cc: bitbake-devel, Patches and discussions about the oe-core layer

[-- Attachment #1: Type: text/plain, Size: 3280 bytes --]

On Thu, Jul 19, 2012 at 01:18:12PM +0200, Martin Jansa wrote:
> On Thu, Jul 19, 2012 at 11:15:48AM +0100, Richard Purdie wrote:
> > On Thu, 2012-07-19 at 11:49 +0200, Martin Jansa wrote:
> > > On Wed, Jul 18, 2012 at 12:40:18PM +0100, Richard Purdie wrote:
> > > > On Wed, 2012-07-18 at 11:17 +0100, Burton, Ross wrote:
> > > > > On 18 July 2012 11:06, Richard Purdie
> > > > > <richard.purdie@linuxfoundation.org> wrote:
> > > > > > I put a proposal to the TSC, that we have bitbake warn/error whenever it
> > > > > > finds tab characters in any python function. The advantage of this is
> > > > > > that we give the user a clear definitive error. The downside is that
> > > > > > we'll have to go through all the metadata and scrub it for the problem.
> > > > > 
> > > > > Have you ran that warning over oe-core to check that there are not any
> > > > > legitimate uses of \t, not for indentation but inside strings?  I
> > > > > can't think of any realistic use but you never know (construct a
> > > > > Makefile in a python function?).
> > > > 
> > > > The check is for actual tab characters, not "\t". There are some
> > > > legitimate users of tab characters which I've replaced with \t in
> > > > strings.
> > > > 
> > > > My current patch work in progress for the conversion is:
> > > > 
> > > > http://git.yoctoproject.org/cgit.cgi/poky-contrib/commit/?h=rpurdie/t14&id=49d3d01f3d61a0eb19b6852229fa8fc26712f653
> > > 
> > > from those 2 patches which were just merged I see that you're converting
> > > strictly python functions, can we extend this tabs->spaces rule also to
> > > bash tasks like do_install etc?
> > 
> > Shell tasks should be tabs according to the style guide. Its harder to
> > check the indentation in those and if the indentation is wrong, it
> > doesn't matter since they're not whitespace sensitive.
> > 
> > So whilst I'd welcome fixing them up, I don't think they need bitbake
> > enforcing policy in the same way as python functions.
> 
> Agreed about not forcing the check or updating all .bb/.inc files with
> this now, but maybe style guide should be updated now?
> 
> I really don't like files with mixed indentation (even when it doesn't
> hurt) especially with a lot of files not conforming to style guide now,
> using even mix of tabs/spaces on the same line..
> 
> FWIW: I've prepared patch for whole meta-smartphone to unify that and
> I've sent RFC for few bbclasses in meta-oe too.

I know you've sent me link do different style guide last time I've
asked, but first google hit (for openembedded style guide):
http://www.openembedded.org/wiki/Styleguide

says about tabs only this:
- Use spaces for indentation as developers tends to use different amount
  of spaces per one tab.

So only in yocto wiki there are 2 more bullets after that
https://wiki.yoctoproject.org/wiki/Recipe_%26_Patch_Style_Guide
- Use spaces for indentation as developers tends to use different amount
  of spaces per one tab.
- Shell functions should use tabs
- Python functions should use spaces (4 spaces per indent).

And yocto style guide is not in first 5 pages of result when searching
for "openembedded style guide".

Cheers,
-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 205 bytes --]

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

* Re: [bitbake-devel] PLEASE READ: Major change landing shortly (python whitespace)
@ 2012-07-19 11:27             ` Martin Jansa
  0 siblings, 0 replies; 24+ messages in thread
From: Martin Jansa @ 2012-07-19 11:27 UTC (permalink / raw)
  To: Richard Purdie
  Cc: bitbake-devel, Patches and discussions about the oe-core layer

[-- Attachment #1: Type: text/plain, Size: 3280 bytes --]

On Thu, Jul 19, 2012 at 01:18:12PM +0200, Martin Jansa wrote:
> On Thu, Jul 19, 2012 at 11:15:48AM +0100, Richard Purdie wrote:
> > On Thu, 2012-07-19 at 11:49 +0200, Martin Jansa wrote:
> > > On Wed, Jul 18, 2012 at 12:40:18PM +0100, Richard Purdie wrote:
> > > > On Wed, 2012-07-18 at 11:17 +0100, Burton, Ross wrote:
> > > > > On 18 July 2012 11:06, Richard Purdie
> > > > > <richard.purdie@linuxfoundation.org> wrote:
> > > > > > I put a proposal to the TSC, that we have bitbake warn/error whenever it
> > > > > > finds tab characters in any python function. The advantage of this is
> > > > > > that we give the user a clear definitive error. The downside is that
> > > > > > we'll have to go through all the metadata and scrub it for the problem.
> > > > > 
> > > > > Have you ran that warning over oe-core to check that there are not any
> > > > > legitimate uses of \t, not for indentation but inside strings?  I
> > > > > can't think of any realistic use but you never know (construct a
> > > > > Makefile in a python function?).
> > > > 
> > > > The check is for actual tab characters, not "\t". There are some
> > > > legitimate users of tab characters which I've replaced with \t in
> > > > strings.
> > > > 
> > > > My current patch work in progress for the conversion is:
> > > > 
> > > > http://git.yoctoproject.org/cgit.cgi/poky-contrib/commit/?h=rpurdie/t14&id=49d3d01f3d61a0eb19b6852229fa8fc26712f653
> > > 
> > > from those 2 patches which were just merged I see that you're converting
> > > strictly python functions, can we extend this tabs->spaces rule also to
> > > bash tasks like do_install etc?
> > 
> > Shell tasks should be tabs according to the style guide. Its harder to
> > check the indentation in those and if the indentation is wrong, it
> > doesn't matter since they're not whitespace sensitive.
> > 
> > So whilst I'd welcome fixing them up, I don't think they need bitbake
> > enforcing policy in the same way as python functions.
> 
> Agreed about not forcing the check or updating all .bb/.inc files with
> this now, but maybe style guide should be updated now?
> 
> I really don't like files with mixed indentation (even when it doesn't
> hurt) especially with a lot of files not conforming to style guide now,
> using even mix of tabs/spaces on the same line..
> 
> FWIW: I've prepared patch for whole meta-smartphone to unify that and
> I've sent RFC for few bbclasses in meta-oe too.

I know you've sent me link do different style guide last time I've
asked, but first google hit (for openembedded style guide):
http://www.openembedded.org/wiki/Styleguide

says about tabs only this:
- Use spaces for indentation as developers tends to use different amount
  of spaces per one tab.

So only in yocto wiki there are 2 more bullets after that
https://wiki.yoctoproject.org/wiki/Recipe_%26_Patch_Style_Guide
- Use spaces for indentation as developers tends to use different amount
  of spaces per one tab.
- Shell functions should use tabs
- Python functions should use spaces (4 spaces per indent).

And yocto style guide is not in first 5 pages of result when searching
for "openembedded style guide".

Cheers,
-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 205 bytes --]

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

* Re: PLEASE READ: Major change landing shortly (python whitespace)
  2012-07-18 10:06 PLEASE READ: Major change landing shortly (python whitespace) Richard Purdie
  2012-07-18 10:17   ` Burton, Ross
  2012-07-18 10:40   ` [bitbake-devel] " Martin Jansa
@ 2012-07-19 14:44 ` Jack Mitchell
  2012-07-19 15:23   ` Martin Jansa
  2 siblings, 1 reply; 24+ messages in thread
From: Jack Mitchell @ 2012-07-19 14:44 UTC (permalink / raw)
  To: openembedded-core

On 18/07/12 11:06, Richard Purdie wrote:
> snip
>
> So I am going to:
>
> a) Try and flush through as many pending patches as I can.
> b) Check in a warning into bitbake master and increase its version
> c) Require that version in OE-Core
> d) Commit a significant set of whitespace changes to OE-Core, resolving
> all the warnings for OE-Core.
>
> I plan to do this, tomorrow, Thursday.
>

Richard,

I think I've hit an issue with the white spaces today:

    NOTE: Resolving any missing task queue dependencies
    NOTE: Preparing runqueue
    NOTE: Executing RunQueue Tasks
    NOTE: Running task 1 of 2 (ID: 0,
virtual:native:/mnt/storage/yoctoBuilds/poky-vanilla.git/meta/recipes-devtools/bison/bison_2.5.bb,
    do_clean)
    NOTE: package bison-native-2.5-r2: task do_clean: Started
    ERROR: Error executing a python function in
/mnt/storage/yoctoBuilds/poky-vanilla.git/meta/recipes-devtools/bison/bison_2.5.bb:
    OSError: [Errno 39] Directory not empty:
'/mnt/storage/yoctoBuilds/poky-vanilla.git/build/tmp/work/x86_64-linux/bison-native-2.5-r2/temp'

    ERROR: The stack trace of python calls that resulted in this
    exception/failure was:
    ERROR:   File "do_clean", line 16, in <module>
    ERROR:
    ERROR:   File "do_clean", line 6, in do_clean
    ERROR:
    ERROR:   File
"/mnt/storage/yoctoBuilds/poky-vanilla.git/meta/lib/oe/path.py",
    line 94, in remove
    ERROR:     shutil.rmtree(name)
    ERROR:
    ERROR:   File "/usr/lib/python2.7/shutil.py", line 245, in rmtree
    ERROR:     rmtree(fullname, ignore_errors, onerror)
    ERROR:
    ERROR:   File "/usr/lib/python2.7/shutil.py", line 254, in rmtree
    ERROR:     onerror(os.rmdir, path, sys.exc_info())
    ERROR:
    ERROR:   File "/usr/lib/python2.7/shutil.py", line 252, in rmtree
    ERROR:     os.rmdir(path)
    ERROR:
    ERROR: The code that was being executed was:
    ERROR:      0012:    for f in (d.getVar('CLEANFUNCS', True) or
    '').split():
    ERROR:      0013:        bb.build.exec_func(f, d)
    ERROR:      0014:
    ERROR:      0015:
    ERROR:  *** 0016:do_clean(d)
    ERROR:      0017:
    ERROR: (file: 'do_clean', lineno: 16, function: <module>)
    ERROR:      0002:def do_clean(d):
    ERROR:      0003:    """clear the build and temp directories"""
    ERROR:      0004:    dir =
d.expand("/mnt/storage/yoctoBuilds/poky-vanilla.git/build/tmp/work/x86_64-linux/bison-native-2.5-r2")
    ERROR:      0005:    bb.note("Removing " + dir)
    ERROR:  *** 0006:    oe.path.remove(dir)
    ERROR:      0007:
    ERROR:      0008:    dir = "%s.*" % 
bb.data.expand(d.getVar('STAMP'), d)
    ERROR:      0009:    bb.note("Removing " + dir)
    ERROR:      0010:    oe.path.remove(dir)
    ERROR: (file: 'do_clean', lineno: 6, function: do_clean)
    ERROR: Function failed: do_clean
    NOTE: package bison-native-2.5-r2: task do_clean: Failed
    ERROR: Task 0
(virtual:native:/mnt/storage/yoctoBuilds/poky-vanilla.git/meta/recipes-devtools/bison/bison_2.5.bb,
    do_clean) failed with exit code '1'
    NOTE: Tasks Summary: Attempted 1 tasks of which 0 didn't need to be
    rerun and 1 failed.

    Summary: 1 task failed:
virtual:native:/mnt/storage/yoctoBuilds/poky-vanilla.git/meta/recipes-devtools/bison/bison_2.5.bb,
    do_clean
    Summary: There was 1 WARNING message shown.
    Summary: There were 37 ERROR messages shown, returning a non-zero
    exit code.


Cheers,
Jack.

-- 

   Jack Mitchell (jack@embed.me.uk)
   Embedded Systems Engineer
   http://www.embed.me.uk

--




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

* Re: PLEASE READ: Major change landing shortly (python whitespace)
  2012-07-19 14:44 ` Jack Mitchell
@ 2012-07-19 15:23   ` Martin Jansa
  2012-07-20  9:38     ` Jack Mitchell
  0 siblings, 1 reply; 24+ messages in thread
From: Martin Jansa @ 2012-07-19 15:23 UTC (permalink / raw)
  To: ml, Patches and discussions about the oe-core layer

[-- Attachment #1: Type: text/plain, Size: 4324 bytes --]

On Thu, Jul 19, 2012 at 03:44:50PM +0100, Jack Mitchell wrote:
> On 18/07/12 11:06, Richard Purdie wrote:
> > snip
> >
> > So I am going to:
> >
> > a) Try and flush through as many pending patches as I can.
> > b) Check in a warning into bitbake master and increase its version
> > c) Require that version in OE-Core
> > d) Commit a significant set of whitespace changes to OE-Core, resolving
> > all the warnings for OE-Core.
> >
> > I plan to do this, tomorrow, Thursday.
> >
> 
> Richard,
> 
> I think I've hit an issue with the white spaces today:
> 
>     NOTE: Resolving any missing task queue dependencies
>     NOTE: Preparing runqueue
>     NOTE: Executing RunQueue Tasks
>     NOTE: Running task 1 of 2 (ID: 0,
> virtual:native:/mnt/storage/yoctoBuilds/poky-vanilla.git/meta/recipes-devtools/bison/bison_2.5.bb,
>     do_clean)
>     NOTE: package bison-native-2.5-r2: task do_clean: Started
>     ERROR: Error executing a python function in
> /mnt/storage/yoctoBuilds/poky-vanilla.git/meta/recipes-devtools/bison/bison_2.5.bb:
>     OSError: [Errno 39] Directory not empty:
> '/mnt/storage/yoctoBuilds/poky-vanilla.git/build/tmp/work/x86_64-linux/bison-native-2.5-r2/temp'

Do you think that this directory is full of white spaces? :)

I don't think this is related to todays white space changes, because I
see errors like this from time to time..

Cheers,


> 
>     ERROR: The stack trace of python calls that resulted in this
>     exception/failure was:
>     ERROR:   File "do_clean", line 16, in <module>
>     ERROR:
>     ERROR:   File "do_clean", line 6, in do_clean
>     ERROR:
>     ERROR:   File
> "/mnt/storage/yoctoBuilds/poky-vanilla.git/meta/lib/oe/path.py",
>     line 94, in remove
>     ERROR:     shutil.rmtree(name)
>     ERROR:
>     ERROR:   File "/usr/lib/python2.7/shutil.py", line 245, in rmtree
>     ERROR:     rmtree(fullname, ignore_errors, onerror)
>     ERROR:
>     ERROR:   File "/usr/lib/python2.7/shutil.py", line 254, in rmtree
>     ERROR:     onerror(os.rmdir, path, sys.exc_info())
>     ERROR:
>     ERROR:   File "/usr/lib/python2.7/shutil.py", line 252, in rmtree
>     ERROR:     os.rmdir(path)
>     ERROR:
>     ERROR: The code that was being executed was:
>     ERROR:      0012:    for f in (d.getVar('CLEANFUNCS', True) or
>     '').split():
>     ERROR:      0013:        bb.build.exec_func(f, d)
>     ERROR:      0014:
>     ERROR:      0015:
>     ERROR:  *** 0016:do_clean(d)
>     ERROR:      0017:
>     ERROR: (file: 'do_clean', lineno: 16, function: <module>)
>     ERROR:      0002:def do_clean(d):
>     ERROR:      0003:    """clear the build and temp directories"""
>     ERROR:      0004:    dir =
> d.expand("/mnt/storage/yoctoBuilds/poky-vanilla.git/build/tmp/work/x86_64-linux/bison-native-2.5-r2")
>     ERROR:      0005:    bb.note("Removing " + dir)
>     ERROR:  *** 0006:    oe.path.remove(dir)
>     ERROR:      0007:
>     ERROR:      0008:    dir = "%s.*" % 
> bb.data.expand(d.getVar('STAMP'), d)
>     ERROR:      0009:    bb.note("Removing " + dir)
>     ERROR:      0010:    oe.path.remove(dir)
>     ERROR: (file: 'do_clean', lineno: 6, function: do_clean)
>     ERROR: Function failed: do_clean
>     NOTE: package bison-native-2.5-r2: task do_clean: Failed
>     ERROR: Task 0
> (virtual:native:/mnt/storage/yoctoBuilds/poky-vanilla.git/meta/recipes-devtools/bison/bison_2.5.bb,
>     do_clean) failed with exit code '1'
>     NOTE: Tasks Summary: Attempted 1 tasks of which 0 didn't need to be
>     rerun and 1 failed.
> 
>     Summary: 1 task failed:
> virtual:native:/mnt/storage/yoctoBuilds/poky-vanilla.git/meta/recipes-devtools/bison/bison_2.5.bb,
>     do_clean
>     Summary: There was 1 WARNING message shown.
>     Summary: There were 37 ERROR messages shown, returning a non-zero
>     exit code.
> 
> 
> Cheers,
> Jack.
> 
> -- 
> 
>    Jack Mitchell (jack@embed.me.uk)
>    Embedded Systems Engineer
>    http://www.embed.me.uk
> 
> --
> 
> 
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core

-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 205 bytes --]

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

* Re: PLEASE READ: Major change landing shortly (python whitespace)
  2012-07-19 15:23   ` Martin Jansa
@ 2012-07-20  9:38     ` Jack Mitchell
  0 siblings, 0 replies; 24+ messages in thread
From: Jack Mitchell @ 2012-07-20  9:38 UTC (permalink / raw)
  To: Martin Jansa; +Cc: Patches and discussions about the oe-core layer

On 19/07/12 16:23, Martin Jansa wrote:
> On Thu, Jul 19, 2012 at 03:44:50PM +0100, Jack Mitchell wrote:
>> On 18/07/12 11:06, Richard Purdie wrote:
>>> snip
>>>
>>> So I am going to:
>>>
>>> a) Try and flush through as many pending patches as I can.
>>> b) Check in a warning into bitbake master and increase its version
>>> c) Require that version in OE-Core
>>> d) Commit a significant set of whitespace changes to OE-Core, resolving
>>> all the warnings for OE-Core.
>>>
>>> I plan to do this, tomorrow, Thursday.
>>>
>> Richard,
>>
>> I think I've hit an issue with the white spaces today:
>>
>>      NOTE: Resolving any missing task queue dependencies
>>      NOTE: Preparing runqueue
>>      NOTE: Executing RunQueue Tasks
>>      NOTE: Running task 1 of 2 (ID: 0,
>> virtual:native:/mnt/storage/yoctoBuilds/poky-vanilla.git/meta/recipes-devtools/bison/bison_2.5.bb,
>>      do_clean)
>>      NOTE: package bison-native-2.5-r2: task do_clean: Started
>>      ERROR: Error executing a python function in
>> /mnt/storage/yoctoBuilds/poky-vanilla.git/meta/recipes-devtools/bison/bison_2.5.bb:
>>      OSError: [Errno 39] Directory not empty:
>> '/mnt/storage/yoctoBuilds/poky-vanilla.git/build/tmp/work/x86_64-linux/bison-native-2.5-r2/temp'
> Do you think that this directory is full of white spaces? :)
>
> I don't think this is related to todays white space changes, because I
> see errors like this from time to time..
>
> Cheers,
>
>
>>      ERROR: The stack trace of python calls that resulted in this
>>      exception/failure was:
>>      ERROR:   File "do_clean", line 16, in <module>
>>      ERROR:
>>      ERROR:   File "do_clean", line 6, in do_clean
>>      ERROR:
>>      ERROR:   File
>> "/mnt/storage/yoctoBuilds/poky-vanilla.git/meta/lib/oe/path.py",
>>      line 94, in remove
>>      ERROR:     shutil.rmtree(name)
>>      ERROR:
>>      ERROR:   File "/usr/lib/python2.7/shutil.py", line 245, in rmtree
>>      ERROR:     rmtree(fullname, ignore_errors, onerror)
>>      ERROR:
>>      ERROR:   File "/usr/lib/python2.7/shutil.py", line 254, in rmtree
>>      ERROR:     onerror(os.rmdir, path, sys.exc_info())
>>      ERROR:
>>      ERROR:   File "/usr/lib/python2.7/shutil.py", line 252, in rmtree
>>      ERROR:     os.rmdir(path)
>>      ERROR:
>>      ERROR: The code that was being executed was:
>>      ERROR:      0012:    for f in (d.getVar('CLEANFUNCS', True) or
>>      '').split():
>>      ERROR:      0013:        bb.build.exec_func(f, d)
>>      ERROR:      0014:
>>      ERROR:      0015:
>>      ERROR:  *** 0016:do_clean(d)
>>      ERROR:      0017:
>>      ERROR: (file: 'do_clean', lineno: 16, function: <module>)
>>      ERROR:      0002:def do_clean(d):
>>      ERROR:      0003:    """clear the build and temp directories"""
>>      ERROR:      0004:    dir =
>> d.expand("/mnt/storage/yoctoBuilds/poky-vanilla.git/build/tmp/work/x86_64-linux/bison-native-2.5-r2")
>>      ERROR:      0005:    bb.note("Removing " + dir)
>>      ERROR:  *** 0006:    oe.path.remove(dir)
>>      ERROR:      0007:
>>      ERROR:      0008:    dir = "%s.*" %
>> bb.data.expand(d.getVar('STAMP'), d)
>>      ERROR:      0009:    bb.note("Removing " + dir)
>>      ERROR:      0010:    oe.path.remove(dir)
>>      ERROR: (file: 'do_clean', lineno: 6, function: do_clean)
>>      ERROR: Function failed: do_clean
>>      NOTE: package bison-native-2.5-r2: task do_clean: Failed
>>      ERROR: Task 0
>> (virtual:native:/mnt/storage/yoctoBuilds/poky-vanilla.git/meta/recipes-devtools/bison/bison_2.5.bb,
>>      do_clean) failed with exit code '1'
>>      NOTE: Tasks Summary: Attempted 1 tasks of which 0 didn't need to be
>>      rerun and 1 failed.
>>
>>      Summary: 1 task failed:
>> virtual:native:/mnt/storage/yoctoBuilds/poky-vanilla.git/meta/recipes-devtools/bison/bison_2.5.bb,
>>      do_clean
>>      Summary: There was 1 WARNING message shown.
>>      Summary: There were 37 ERROR messages shown, returning a non-zero
>>      exit code.
>>
>>
>> Cheers,
>> Jack.
>>
>> -- 
>>
>>     Jack Mitchell (jack@embed.me.uk)
>>     Embedded Systems Engineer
>>     http://www.embed.me.uk
>>
>> --
>>
>>
>> _______________________________________________
>> Openembedded-core mailing list
>> Openembedded-core@lists.openembedded.org
>> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core

Ok, so I should just rm -rf the Bison directory and have another go? 
I've never seen this before and it happened as soon as I pulled the 
white-space changes along with the error looking to be in the python 
function so I assumed a mishap somewhere...

My python isn't great and the trace made it look like it was pointing to 
failures with all the inconsistent spacing in the trace output.

Cheers,

-- 

   Jack Mitchell (jack@embed.me.uk)
   Embedded Systems Engineer
   http://www.embed.me.uk

--




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

end of thread, other threads:[~2012-07-20  9:54 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-18 10:06 PLEASE READ: Major change landing shortly (python whitespace) Richard Purdie
2012-07-18 10:17 ` [OE-core] " Burton, Ross
2012-07-18 10:17   ` Burton, Ross
2012-07-18 11:40   ` [OE-core] " Richard Purdie
2012-07-18 11:40     ` Richard Purdie
2012-07-18 21:43     ` [OE-core] " Martin Jansa
2012-07-18 21:43       ` [bitbake-devel] " Martin Jansa
2012-07-19  8:26       ` [OE-core] " Henning Heinold
2012-07-19  8:26         ` [bitbake-devel] " Henning Heinold
2012-07-19  9:49     ` [OE-core] " Martin Jansa
2012-07-19  9:49       ` [bitbake-devel] " Martin Jansa
2012-07-19 10:15       ` [OE-core] " Richard Purdie
2012-07-19 10:15         ` [bitbake-devel] " Richard Purdie
2012-07-19 11:18         ` [OE-core] " Martin Jansa
2012-07-19 11:18           ` [bitbake-devel] " Martin Jansa
2012-07-19 11:27           ` [OE-core] " Martin Jansa
2012-07-19 11:27             ` [bitbake-devel] " Martin Jansa
2012-07-18 10:40 ` Martin Jansa
2012-07-18 10:40   ` [bitbake-devel] " Martin Jansa
2012-07-18 13:11   ` Richard Purdie
2012-07-18 13:11     ` [bitbake-devel] " Richard Purdie
2012-07-19 14:44 ` Jack Mitchell
2012-07-19 15:23   ` Martin Jansa
2012-07-20  9:38     ` Jack Mitchell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.