diff options
Diffstat (limited to 'meta/lib/patchtest/tests/test_metadata_max_length.py')
| -rw-r--r-- | meta/lib/patchtest/tests/test_metadata_max_length.py | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/meta/lib/patchtest/tests/test_metadata_max_length.py b/meta/lib/patchtest/tests/test_metadata_max_length.py deleted file mode 100644 index 98c48ef787..0000000000 --- a/meta/lib/patchtest/tests/test_metadata_max_length.py +++ /dev/null | |||
| @@ -1,25 +0,0 @@ | |||
| 1 | # Checks related to patch line lengths | ||
| 2 | # | ||
| 3 | # Copyright (C) 2016 Intel Corporation | ||
| 4 | # | ||
| 5 | # SPDX-License-Identifier: GPL-2.0-only | ||
| 6 | |||
| 7 | import base | ||
| 8 | import pyparsing | ||
| 9 | |||
| 10 | class MaxLength(base.Base): | ||
| 11 | add_mark = pyparsing.Regex('\+ ') | ||
| 12 | max_length = 200 | ||
| 13 | |||
| 14 | def test_max_line_length(self): | ||
| 15 | for patch in self.patchset: | ||
| 16 | # for the moment, we are just interested in metadata | ||
| 17 | if patch.path.endswith('.patch'): | ||
| 18 | continue | ||
| 19 | payload = str(patch) | ||
| 20 | for line in payload.splitlines(): | ||
| 21 | if self.add_mark.search_string(line): | ||
| 22 | current_line_length = len(line[1:]) | ||
| 23 | if current_line_length > self.max_length: | ||
| 24 | self.fail('Patch line too long (current length %s, maximum is %s)' % (current_line_length, self.max_length), | ||
| 25 | data=[('Patch', patch.path), ('Line', '%s ...' % line[0:80])]) | ||
