[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openembedded-core
Subject:    [OE-core] [PATCH] yocto-check-layer: Address Bug#11131
From:       "Dhruva Gole" <goledhruva () gmail ! com>
Date:       2021-11-30 5:55:35
Message-ID: 20211130054335.58255-1-goledhruva () gmail ! com
[Download RAW message or body]

Content-Transfer-Encoding: 8bit

This adds:
- Test case to review if the README file specifies the maintainer.
- Test case to review if the README file specifies the word patch.
- Test case to review if the README file contains an email address.

Signed-off-by: Dhruva Gole <goledhruva@gmail.com>
---
 scripts/lib/checklayer/cases/common.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/scripts/lib/checklayer/cases/common.py b/scripts/lib/checklayer/cases/common.py
index b82304e361..8d4aab7973 100644
--- a/scripts/lib/checklayer/cases/common.py
+++ b/scripts/lib/checklayer/cases/common.py
@@ -6,6 +6,7 @@
 import glob
 import os
 import unittest
+import re
 from checklayer import get_signatures, LayerType, check_command, get_depgraph, compare_signatures
 from checklayer.case import OECheckLayerTestCase
 
@@ -25,6 +26,11 @@ class CommonCheckLayer(OECheckLayerTestCase):
             data = f.read()
         self.assertTrue(data,
                 msg="Layer contains a README file but it is empty.")
+        self.assertIn('maintainer',data)
+        self.assertIn('patch',data)
+        # Check that there is an email address in the README
+        email_regex = re.compile(r"[^@]+@[^@]+")
+        self.assertTrue(email_regex.match(data))
 
     def test_parse(self):
         check_command('Layer %s failed to parse.' % self.tc.layer['name'],
-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#158966): https://lists.openembedded.org/g/openembedded-core/message/158966
Mute This Topic: https://lists.openembedded.org/mt/87397246/4454766
Group Owner: openembedded-core+owner@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [openembedded-core@marc.info]
-=-=-=-=-=-=-=-=-=-=-=-



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic