public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: Ola x Nilsson <ola.x.nilsson@axis.com>
To: Saul Wold <sgw@bigsur.com>
Cc: <richard.purdie@linuxfoundation.org>,
	<openembedded-core@lists.openembedded.org>
Subject: Re: [OE-core] [PATCH 1/1] check-bbclasses: add new script to check bbclasses
Date: Mon, 29 Jan 2024 11:49:08 +0100	[thread overview]
Message-ID: <jwqv87cv28z.fsf@axis.com> (raw)
In-Reply-To: <20240128000405.3074503-2-sgw@bigsur.com>


On Sat, Jan 27 2024, Saul Wold wrote:

> FIXES [YOCTO #14235]
>
> This script is a starting point for a "linter" for bbclass files.
> Currently it will check for '_' in the bbclass filename and '-' in
> addtask or EXPORT_FUNCTION. It will print warnings only no errors.
>
> Signed-off-by: Saul Wold <sgw@bigsur.com>
> ---
> +                            #
> +                            # Check for underscore in bbclass filename
> +                            #
> + if c.name.endswith(".bbclass") and "_" in c.name and not c.name in
> oecore_known_classes:
> +
> + print("Warning: BBClass file name contains '_': " + path + "/" +
> entry.name + "/" + c.name)

Why would '-' in class names be preferred?

Isn't EXPORT_FUNCTION supposed to be used like this:

```
myclass.bbclass:

myclass_do_something() {
 ...
}
addtask something

EXPORT_FUNCTION do_something
```

and the generated script would be

```
myclass_do_something() {
   ...
}

do_something() {
   myclass_do_something()
}

do_something
```

which would not work for shell functions when the class name contains
'-'.

What am I missing here?

-- 
Ola x Nilsson


      parent reply	other threads:[~2024-01-29 10:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-28  0:04 [PATCH 0/1] BBClass checker script (14235) Saul Wold
2024-01-28  0:04 ` [PATCH 1/1] check-bbclasses: add new script to check bbclasses Saul Wold
2024-01-29  9:05   ` [OE-core] " Jose Quaresma
2024-01-29 10:49   ` Ola x Nilsson [this message]

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=jwqv87cv28z.fsf@axis.com \
    --to=ola.x.nilsson@axis.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=richard.purdie@linuxfoundation.org \
    --cc=sgw@bigsur.com \
    /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