[1/1] uboot-sign.bbclass: Remove tab indentations in python code

Submitted by Robert Yang on Nov. 23, 2018, 11:08 a.m. | Patch ID: 156570

Details

Message ID 85fe4df7c0ce3e3c8017fbf410d98498669f7363.1542971171.git.liezhi.yang@windriver.com
State New
Headers show

Commit Message

Robert Yang Nov. 23, 2018, 11:08 a.m.
Use 4 spaces to replace a tab.

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
 meta/classes/uboot-sign.bbclass | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

Patch hide | download patch | download mbox

diff --git a/meta/classes/uboot-sign.bbclass b/meta/classes/uboot-sign.bbclass
index 0e5e1b1..03100b8 100644
--- a/meta/classes/uboot-sign.bbclass
+++ b/meta/classes/uboot-sign.bbclass
@@ -93,14 +93,14 @@  do_install_append() {
 }
 
 python () {
-	if d.getVar('UBOOT_SIGN_ENABLE') == '1' and d.getVar('PN') == d.getVar('UBOOT_PN'):
-		kernel_pn = d.getVar('PREFERRED_PROVIDER_virtual/kernel')
+    if d.getVar('UBOOT_SIGN_ENABLE') == '1' and d.getVar('PN') == d.getVar('UBOOT_PN'):
+        kernel_pn = d.getVar('PREFERRED_PROVIDER_virtual/kernel')
 
-		# Make "bitbake u-boot -cdeploy" deploys the signed u-boot.dtb
-		d.appendVarFlag('do_deploy', 'depends', ' %s:do_deploy' % kernel_pn)
+        # Make "bitbake u-boot -cdeploy" deploys the signed u-boot.dtb
+        d.appendVarFlag('do_deploy', 'depends', ' %s:do_deploy' % kernel_pn)
 
-		# kernerl's do_deploy is a litle special, so we can't use
-		# do_deploy_append, otherwise it would override
-		# kernel_do_deploy.
-		d.appendVarFlag('do_deploy', 'prefuncs', ' concat_dtb')
+        # kernerl's do_deploy is a litle special, so we can't use
+        # do_deploy_append, otherwise it would override
+        # kernel_do_deploy.
+        d.appendVarFlag('do_deploy', 'prefuncs', ' concat_dtb')
 }

Comments

Martin Jansa Dec. 5, 2018, 2:40 p.m.
I wish we could have the same warning for shell code as well :).

Can you please take care of meta-gplv2 as well?
WARNING: meta-gplv2/recipes-core/coreutils/coreutils_6.9.bb: python should
use 4 spaces indentation, but found tabs in coreutils_6.9.bb, line 95

I've sent patch for meta-oe issue:
http://lists.openembedded.org/pipermail/openembedded-devel/2018-December/197803.html


On Fri, Nov 23, 2018 at 11:51 AM Robert Yang <liezhi.yang@windriver.com>
wrote:

> Use 4 spaces to replace a tab.
>
> Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
> ---
>  meta/classes/uboot-sign.bbclass | 16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/meta/classes/uboot-sign.bbclass
> b/meta/classes/uboot-sign.bbclass
> index 0e5e1b1..03100b8 100644
> --- a/meta/classes/uboot-sign.bbclass
> +++ b/meta/classes/uboot-sign.bbclass
> @@ -93,14 +93,14 @@ do_install_append() {
>  }
>
>  python () {
> -       if d.getVar('UBOOT_SIGN_ENABLE') == '1' and d.getVar('PN') ==
> d.getVar('UBOOT_PN'):
> -               kernel_pn = d.getVar('PREFERRED_PROVIDER_virtual/kernel')
> +    if d.getVar('UBOOT_SIGN_ENABLE') == '1' and d.getVar('PN') ==
> d.getVar('UBOOT_PN'):
> +        kernel_pn = d.getVar('PREFERRED_PROVIDER_virtual/kernel')
>
> -               # Make "bitbake u-boot -cdeploy" deploys the signed
> u-boot.dtb
> -               d.appendVarFlag('do_deploy', 'depends', ' %s:do_deploy' %
> kernel_pn)
> +        # Make "bitbake u-boot -cdeploy" deploys the signed u-boot.dtb
> +        d.appendVarFlag('do_deploy', 'depends', ' %s:do_deploy' %
> kernel_pn)
>
> -               # kernerl's do_deploy is a litle special, so we can't use
> -               # do_deploy_append, otherwise it would override
> -               # kernel_do_deploy.
> -               d.appendVarFlag('do_deploy', 'prefuncs', ' concat_dtb')
> +        # kernerl's do_deploy is a litle special, so we can't use
> +        # do_deploy_append, otherwise it would override
> +        # kernel_do_deploy.
> +        d.appendVarFlag('do_deploy', 'prefuncs', ' concat_dtb')
>  }
> --
> 2.7.4
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>
Robert Yang Dec. 6, 2018, 2:59 a.m.
Hi Martin,

On 12/5/18 10:40 PM, Martin Jansa wrote:
> I wish we could have the same warning for shell code as well :).
>

According to oe's Format Guidelines:

https://www.openembedded.org/wiki/Styleguide#Format_Guidelines

- Python functions must be four space indented - no tabs.
- Shell functions in OE-Core usually use tabs for indentation, but other layers 
usually use consistent indentation with 4 spaces (in shell functions, python 
functions and for indentation of multi-line variables)


So I think that shell code can use either spaces or tabs as indentation.

> Can you please take care of meta-gplv2 as well?
> WARNING: meta-gplv2/recipes-core/coreutils/coreutils_6.9.bb 
> <http://coreutils_6.9.bb>: python should use 4 spaces indentation, but found 
> tabs in coreutils_6.9.bb <http://coreutils_6.9.bb>, line 95

Thanks, I've sent a patch for it.

// Robert

> 
> I've sent patch for meta-oe issue:
> http://lists.openembedded.org/pipermail/openembedded-devel/2018-December/197803.html
> 
> 
> On Fri, Nov 23, 2018 at 11:51 AM Robert Yang <liezhi.yang@windriver.com 
> <mailto:liezhi.yang@windriver.com>> wrote:
> 
>     Use 4 spaces to replace a tab.
> 
>     Signed-off-by: Robert Yang <liezhi.yang@windriver.com
>     <mailto:liezhi.yang@windriver.com>>
>     ---
>       meta/classes/uboot-sign.bbclass | 16 ++++++++--------
>       1 file changed, 8 insertions(+), 8 deletions(-)
> 
>     diff --git a/meta/classes/uboot-sign.bbclass b/meta/classes/uboot-sign.bbclass
>     index 0e5e1b1..03100b8 100644
>     --- a/meta/classes/uboot-sign.bbclass
>     +++ b/meta/classes/uboot-sign.bbclass
>     @@ -93,14 +93,14 @@ do_install_append() {
>       }
> 
>       python () {
>     -       if d.getVar('UBOOT_SIGN_ENABLE') == '1' and d.getVar('PN') ==
>     d.getVar('UBOOT_PN'):
>     -               kernel_pn = d.getVar('PREFERRED_PROVIDER_virtual/kernel')
>     +    if d.getVar('UBOOT_SIGN_ENABLE') == '1' and d.getVar('PN') ==
>     d.getVar('UBOOT_PN'):
>     +        kernel_pn = d.getVar('PREFERRED_PROVIDER_virtual/kernel')
> 
>     -               # Make "bitbake u-boot -cdeploy" deploys the signed u-boot.dtb
>     -               d.appendVarFlag('do_deploy', 'depends', ' %s:do_deploy' %
>     kernel_pn)
>     +        # Make "bitbake u-boot -cdeploy" deploys the signed u-boot.dtb
>     +        d.appendVarFlag('do_deploy', 'depends', ' %s:do_deploy' % kernel_pn)
> 
>     -               # kernerl's do_deploy is a litle special, so we can't use
>     -               # do_deploy_append, otherwise it would override
>     -               # kernel_do_deploy.
>     -               d.appendVarFlag('do_deploy', 'prefuncs', ' concat_dtb')
>     +        # kernerl's do_deploy is a litle special, so we can't use
>     +        # do_deploy_append, otherwise it would override
>     +        # kernel_do_deploy.
>     +        d.appendVarFlag('do_deploy', 'prefuncs', ' concat_dtb')
>       }
>     -- 
>     2.7.4
> 
>     -- 
>     _______________________________________________
>     Openembedded-core mailing list
>     Openembedded-core@lists.openembedded.org
>     <mailto:Openembedded-core@lists.openembedded.org>
>     http://lists.openembedded.org/mailman/listinfo/openembedded-core
>
Martin Jansa Dec. 6, 2018, 8:15 a.m.
> So I think that shell code can use either spaces or tabs as indentation.

True, that's why I used "I wish" and ":)" because as Christmas gift I
always wanted consistency (not only between layers, but between shell and
python code as well).

On Thu, Dec 6, 2018 at 3:55 AM Robert Yang <liezhi.yang@windriver.com>
wrote:

> Hi Martin,
>
> On 12/5/18 10:40 PM, Martin Jansa wrote:
> > I wish we could have the same warning for shell code as well :).
> >
>
> According to oe's Format Guidelines:
>
> https://www.openembedded.org/wiki/Styleguide#Format_Guidelines
>
> - Python functions must be four space indented - no tabs.
> - Shell functions in OE-Core usually use tabs for indentation, but other
> layers
> usually use consistent indentation with 4 spaces (in shell functions,
> python
> functions and for indentation of multi-line variables)
>
>
> So I think that shell code can use either spaces or tabs as indentation.
>
> > Can you please take care of meta-gplv2 as well?
> > WARNING: meta-gplv2/recipes-core/coreutils/coreutils_6.9.bb
> > <http://coreutils_6.9.bb>: python should use 4 spaces indentation, but
> found
> > tabs in coreutils_6.9.bb <http://coreutils_6.9.bb>, line 95
>
> Thanks, I've sent a patch for it.
>
> // Robert
>
> >
> > I've sent patch for meta-oe issue:
> >
> http://lists.openembedded.org/pipermail/openembedded-devel/2018-December/197803.html
> >
> >
> > On Fri, Nov 23, 2018 at 11:51 AM Robert Yang <liezhi.yang@windriver.com
> > <mailto:liezhi.yang@windriver.com>> wrote:
> >
> >     Use 4 spaces to replace a tab.
> >
> >     Signed-off-by: Robert Yang <liezhi.yang@windriver.com
> >     <mailto:liezhi.yang@windriver.com>>
> >     ---
> >       meta/classes/uboot-sign.bbclass | 16 ++++++++--------
> >       1 file changed, 8 insertions(+), 8 deletions(-)
> >
> >     diff --git a/meta/classes/uboot-sign.bbclass
> b/meta/classes/uboot-sign.bbclass
> >     index 0e5e1b1..03100b8 100644
> >     --- a/meta/classes/uboot-sign.bbclass
> >     +++ b/meta/classes/uboot-sign.bbclass
> >     @@ -93,14 +93,14 @@ do_install_append() {
> >       }
> >
> >       python () {
> >     -       if d.getVar('UBOOT_SIGN_ENABLE') == '1' and d.getVar('PN') ==
> >     d.getVar('UBOOT_PN'):
> >     -               kernel_pn =
> d.getVar('PREFERRED_PROVIDER_virtual/kernel')
> >     +    if d.getVar('UBOOT_SIGN_ENABLE') == '1' and d.getVar('PN') ==
> >     d.getVar('UBOOT_PN'):
> >     +        kernel_pn = d.getVar('PREFERRED_PROVIDER_virtual/kernel')
> >
> >     -               # Make "bitbake u-boot -cdeploy" deploys the signed
> u-boot.dtb
> >     -               d.appendVarFlag('do_deploy', 'depends', '
> %s:do_deploy' %
> >     kernel_pn)
> >     +        # Make "bitbake u-boot -cdeploy" deploys the signed
> u-boot.dtb
> >     +        d.appendVarFlag('do_deploy', 'depends', ' %s:do_deploy' %
> kernel_pn)
> >
> >     -               # kernerl's do_deploy is a litle special, so we
> can't use
> >     -               # do_deploy_append, otherwise it would override
> >     -               # kernel_do_deploy.
> >     -               d.appendVarFlag('do_deploy', 'prefuncs', '
> concat_dtb')
> >     +        # kernerl's do_deploy is a litle special, so we can't use
> >     +        # do_deploy_append, otherwise it would override
> >     +        # kernel_do_deploy.
> >     +        d.appendVarFlag('do_deploy', 'prefuncs', ' concat_dtb')
> >       }
> >     --
> >     2.7.4
> >
> >     --
> >     _______________________________________________
> >     Openembedded-core mailing list
> >     Openembedded-core@lists.openembedded.org
> >     <mailto:Openembedded-core@lists.openembedded.org>
> >     http://lists.openembedded.org/mailman/listinfo/openembedded-core
> >
>