From 06eb8d4d102a003f0c1f2bb0191f8f365b333ebe Mon Sep 17 00:00:00 2001 From: Michal Suchanek Date: Sep 15 2022 11:10:02 +0000 Subject: Merge remote-tracking branch 'origin/users/jdelvare/scripts/for-next' into scripts --- diff --git a/scripts/python/suse_git/header.py b/scripts/python/suse_git/header.py index 43d4406..f3fcd04 100755 --- a/scripts/python/suse_git/header.py +++ b/scripts/python/suse_git/header.py @@ -59,6 +59,11 @@ tag_map = { 'match' : 'Submitted,?\s+.+', 'excludes' : [ 'Git-commit', 'Git-repo' ], }, { + # Catch a frequent misuse of 'Not yet'. + 'match' : 'Not yet,\s+submitted', + 'error' : "Please use 'Submitted'", + 'excludes' : [ 'Git-commit', 'Git-repo' ], + }, { # Should be used rarely. Description should provide # reason for the patch not being accepted upstream. 'name' : 'Not yet', diff --git a/scripts/python/tests/test_header.py b/scripts/python/tests/test_header.py index 5051b39..21daceb 100755 --- a/scripts/python/tests/test_header.py +++ b/scripts/python/tests/test_header.py @@ -715,3 +715,18 @@ References: FATE#123456 Acked-by: developer@suse.com """ self.header = header.Checker(text, False, "patches.kabi/FATE123456_fix_kabi.patch") + + def test_patch_mainline_invalid2(self): + text = """ +From: developer@site.com +Subject: some patch +Patch-mainline: Not yet, submitted 2022-08-23 +References: bsc#12345 +Acked-by: developer@suse.com +""" + with self.assertRaises(header.HeaderException) as cm: + self.header = header.Checker(text) + + e = cm.exception + self.assertEqual(1, e.errors(header.FormatError)) + self.assertEqual(1, e.errors())