Andrew Geissler | 220dafd | 2023-10-04 10:18:08 -0500 | [diff] [blame^] | 1 | # Checks related to the patch's bugzilla tag |
| 2 | # |
| 3 | # Copyright (C) 2016 Intel Corporation |
| 4 | # |
| 5 | # SPDX-License-Identifier: GPL-2.0 |
| 6 | |
| 7 | import re |
| 8 | import base |
| 9 | |
| 10 | class Bugzilla(base.Base): |
| 11 | rexp_detect = re.compile("\[\s?YOCTO.*\]", re.IGNORECASE) |
| 12 | rexp_validation = re.compile("\[(\s?YOCTO\s?#\s?(\d+)\s?,?)+\]", re.IGNORECASE) |
| 13 | |
| 14 | def test_bugzilla_entry_format(self): |
| 15 | for commit in Bugzilla.commits: |
| 16 | for line in commit.commit_message.splitlines(): |
| 17 | if self.rexp_detect.match(line): |
| 18 | if not self.rexp_validation.match(line): |
| 19 | self.fail('Yocto Project bugzilla tag is not correctly formatted', |
| 20 | 'Specify bugzilla ID in commit description with format: "[YOCTO #<bugzilla ID>]"', |
| 21 | commit) |
| 22 | |