priv-kweihmann / oelint-adv

Advanced oelint
BSD 2-Clause "Simplified" License
55 stars 27 forks source link

Detection mis-assigned to inherited class #537

Closed jo-so closed 7 months ago

jo-so commented 7 months ago

I'm having something like this:

diff --git i/tests/test_class_oelint_vars_srcurifile.py w/tests/test_class_oelint_vars_srcurifile.py
index fbaac23..41e0e25 100644
--- i/tests/test_class_oelint_vars_srcurifile.py
+++ w/tests/test_class_oelint_vars_srcurifile.py
@@ -78,6 +78,18 @@ class TestClassOelintVarsSRCURIfile(TestBaseClass):
                                      'classes/foo.bbclass':
                                      'SRC_URI ?= "https://some.corp.org/${PN}"',
                                  },
+                                 {
+                                     'recipes/oelint_adv_test.bb':
+                                     '''
+                                     #
+                                     SRC_URI:append = " file://my.patch"
+                                     inherit foo
+                                     ''',
+                                     'conf/layer.conf':
+                                     ' ',
+                                     'classes/foo.bbclass':
+                                     'SRC_URI = "https://some.corp.org/${PN}"',
+                                 },
                              ],
                              )
     def test_good(self, input_, id_, occurrence):

and it gives me the error

/tmp/tmp34do95uf/classes/foo.bbclass:2:warning:oelint.vars.srcurifile:First item of SRC_URI should not be a file:// fetcher, if multiple fetcher are used

while there's no second line in the foo.bbclass, and, I guess, that's why this nooelint doesn't work

diff --git i/tests/test_class_oelint_vars_srcurifile.py w/tests/test_class_oelint_vars_srcurifile.py
index fbaac23..d8c2da4 100644
--- i/tests/test_class_oelint_vars_srcurifile.py
+++ w/tests/test_class_oelint_vars_srcurifile.py
@@ -78,6 +78,18 @@ class TestClassOelintVarsSRCURIfile(TestBaseClass):
                                      'classes/foo.bbclass':
                                      'SRC_URI ?= "https://some.corp.org/${PN}"',
                                  },
+                                 {
+                                     'recipes/oelint_adv_test.bb':
+                                     '''
+                                     # nooelint: oelint.vars.srcurifile
+                                     SRC_URI:append = " file://my.patch"
+                                     inherit foo
+                                     ''',
+                                     'conf/layer.conf':
+                                     ' ',
+                                     'classes/foo.bbclass':
+                                     'SRC_URI = "https://some.corp.org/${PN}"',
+                                 },
                              ],
                              )
     def test_good(self, input_, id_, occurrence):