diff mbox series

oelint: Remove obsolete class

Message ID 20251211152936.1267124-1-richard.purdie@linuxfoundation.org
State New
Headers show
Series oelint: Remove obsolete class | expand

Commit Message

Richard Purdie Dec. 11, 2025, 3:29 p.m. UTC
Most of the checks in this class are covered by other areas of the code now.
If there is anyting important missing, it should be added elsewhere. The
code hasn't had meaningful changes since 2014. Drop it.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/classes/oelint.bbclass | 90 -------------------------------------
 1 file changed, 90 deletions(-)
 delete mode 100644 meta/classes/oelint.bbclass

Comments

Quentin Schulz Dec. 11, 2025, 3:54 p.m. UTC | #1
Hi Richard,

On 12/11/25 4:29 PM, Richard Purdie via lists.openembedded.org wrote:
> Most of the checks in this class are covered by other areas of the code now.
> If there is anyting important missing, it should be added elsewhere. The
> code hasn't had meaningful changes since 2014. Drop it.
> 

I think the other important piece of information is that nothing seems 
to have ever (since we migrated to git 20 years ago) inherited this 
class in oe-core or meta-openembedded.

So this looks fine for me as it changes nothing to the current state of 
affairs. Adding WindRiver folks for awareness as they were the ones who 
added and modified stuff the most "recently" (10 years ago) so maybe 
they want to have this in their own layer(s) now.

> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> ---
>   meta/classes/oelint.bbclass | 90 -------------------------------------
>   1 file changed, 90 deletions(-)
>   delete mode 100644 meta/classes/oelint.bbclass
> 
> diff --git a/meta/classes/oelint.bbclass b/meta/classes/oelint.bbclass
> deleted file mode 100644
> index 458a25ecc39..00000000000
> --- a/meta/classes/oelint.bbclass
> +++ /dev/null
> @@ -1,90 +0,0 @@
> -#
> -# Copyright OpenEmbedded Contributors
> -#
> -# SPDX-License-Identifier: MIT
> -#
> -
> -addtask lint before do_build
> -do_lint[nostamp] = "1"
> -python do_lint() {
> -    pkgname = d.getVar("PN")
> -
> -    ##############################
> -    # Test that DESCRIPTION exists
> -    #
> -    description = d.getVar("DESCRIPTION", False)
> -    if description[1:10] == '{SUMMARY}':
> -        bb.warn("%s: DESCRIPTION is not set" % pkgname)
> -
> -
> -    ##############################
> -    # Test that HOMEPAGE exists
> -    #
> -    homepage = d.getVar("HOMEPAGE", False)
> -    if homepage == '':
> -        bb.warn("%s: HOMEPAGE is not set" % pkgname)
> -    elif not homepage.startswith("http://") and not homepage.startswith("https://"):
> -        bb.warn("%s: HOMEPAGE doesn't start with http:// or https://" % pkgname)
> -

We may want to check whether HOMEPAGE is an HTTP URI and if it's 
mandatory (Ross says no, the docs say yes) whether it's present...

> -
> -    ##############################
> -    # Test for valid SECTION
> -    #
> -    section = d.getVar("SECTION", False)
> -    if section == '':
> -        bb.warn("%s: SECTION is not set" % pkgname)
> -    elif not section.islower():
> -        bb.warn("%s: SECTION should only use lower case" % pkgname)
> -

that SECTION is all lower-case and present...

> -
> -    ##############################
> -    # Check that all patches have Signed-off-by and Upstream-Status
> -    #
> -    srcuri = d.getVar("SRC_URI", False).split()
> -    fpaths = (d.getVar('FILESPATH') or '').split(':')
> -
> -    def findPatch(patchname):
> -        for dir in fpaths:
> -            patchpath = dir + patchname
> -            if os.path.exists(patchpath):
> -                 return patchpath
> -
> -    def findKey(path, key):
> -        ret = True
> -        f = open('%s' % path, mode = 'r')
> -        line = f.readline()
> -        while line:
> -            if line.find(key) != -1:
> -                ret = False
> -            line = f.readline()
> -        f.close()
> -        return ret
> -
> -    def checkPN(pkgname, varname, str):
> -        if str.find("{PN}") != -1:
> -            bb.warn("%s: should use BPN instead of PN in %s" % (pkgname, varname))
> -        if str.find("{P}") != -1:
> -            bb.warn("%s: should use BP instead of P in %s" % (pkgname, varname))
> -
> -    length = len("file://")
> -    for item in srcuri:
> -        if item.startswith("file://"):
> -            item = item[length:]
> -            if item.endswith(".patch") or item.endswith(".diff"):
> -                path = findPatch(item)
> -                if findKey(path, "Signed-off-by"):
> -                    bb.warn("%s: %s doesn't have Signed-off-by" % (pkgname, item))
> -                if findKey(path, "Upstream-Status"):
> -                    bb.warn("%s: %s doesn't have Upstream-Status" % (pkgname, item))
> -

figure out whether a patch has a missing Signed-off-by or 
Upstream-Status (we already do this but via patchtest, which I'm not 
sure how to use as part of the build like with insane.bbclass)...

> -
> -    ##############################
> -    # Check for ${PN} or ${P} usage in SRC_URI or S
> -    # Should use ${BPN} or ${BP} instead to avoid breaking multilib
> -    #
> -    for s in srcuri:
> -        if not s.startswith("file://"):
> -            checkPN(pkgname, 'SRC_URI', s)
> -

and check whether SRC_URI contains ${PN} or ${P}, all in insane.bbclass 
maybe?

Not a blocker for merging that patch here, just making sure what we want 
to do next with checks that were in here (but again, unused as the class 
wasn't included!).

Cheers,
Quentin
diff mbox series

Patch

diff --git a/meta/classes/oelint.bbclass b/meta/classes/oelint.bbclass
deleted file mode 100644
index 458a25ecc39..00000000000
--- a/meta/classes/oelint.bbclass
+++ /dev/null
@@ -1,90 +0,0 @@ 
-#
-# Copyright OpenEmbedded Contributors
-#
-# SPDX-License-Identifier: MIT
-#
-
-addtask lint before do_build
-do_lint[nostamp] = "1"
-python do_lint() {
-    pkgname = d.getVar("PN")
-
-    ##############################
-    # Test that DESCRIPTION exists
-    #
-    description = d.getVar("DESCRIPTION", False)
-    if description[1:10] == '{SUMMARY}':
-        bb.warn("%s: DESCRIPTION is not set" % pkgname)
-
-
-    ##############################
-    # Test that HOMEPAGE exists
-    #
-    homepage = d.getVar("HOMEPAGE", False)
-    if homepage == '':
-        bb.warn("%s: HOMEPAGE is not set" % pkgname)
-    elif not homepage.startswith("http://") and not homepage.startswith("https://"):
-        bb.warn("%s: HOMEPAGE doesn't start with http:// or https://" % pkgname)
-
-
-    ##############################
-    # Test for valid SECTION
-    #
-    section = d.getVar("SECTION", False)
-    if section == '':
-        bb.warn("%s: SECTION is not set" % pkgname)
-    elif not section.islower():
-        bb.warn("%s: SECTION should only use lower case" % pkgname)
-
-
-    ##############################
-    # Check that all patches have Signed-off-by and Upstream-Status
-    #
-    srcuri = d.getVar("SRC_URI", False).split()
-    fpaths = (d.getVar('FILESPATH') or '').split(':')
-
-    def findPatch(patchname):
-        for dir in fpaths:
-            patchpath = dir + patchname
-            if os.path.exists(patchpath):
-                 return patchpath
-
-    def findKey(path, key):
-        ret = True
-        f = open('%s' % path, mode = 'r')
-        line = f.readline()
-        while line:
-            if line.find(key) != -1:
-                ret = False
-            line = f.readline()
-        f.close()
-        return ret
-
-    def checkPN(pkgname, varname, str):
-        if str.find("{PN}") != -1:
-            bb.warn("%s: should use BPN instead of PN in %s" % (pkgname, varname))
-        if str.find("{P}") != -1:
-            bb.warn("%s: should use BP instead of P in %s" % (pkgname, varname))
-
-    length = len("file://")
-    for item in srcuri:
-        if item.startswith("file://"):
-            item = item[length:]
-            if item.endswith(".patch") or item.endswith(".diff"):
-                path = findPatch(item)
-                if findKey(path, "Signed-off-by"):
-                    bb.warn("%s: %s doesn't have Signed-off-by" % (pkgname, item))
-                if findKey(path, "Upstream-Status"):
-                    bb.warn("%s: %s doesn't have Upstream-Status" % (pkgname, item))
-
-
-    ##############################
-    # Check for ${PN} or ${P} usage in SRC_URI or S
-    # Should use ${BPN} or ${BP} instead to avoid breaking multilib
-    #
-    for s in srcuri:
-        if not s.startswith("file://"):
-            checkPN(pkgname, 'SRC_URI', s)
-
-    checkPN(pkgname, 'S', d.getVar('S', False))
-}