[PATCH v2 22/30] patman: Fix spelling of plural for warning
Simon Glass
sjg at chromium.org
Mon Oct 26 02:04:34 CET 2020
Tidy up the extra 's' when there is only a single warning. Fix the empty
print statement also.
Signed-off-by: Simon Glass <sjg at chromium.org>
---
(no changes since v1)
tools/patman/func_test.py | 5 +++--
tools/patman/patchstream.py | 9 +++++----
2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/tools/patman/func_test.py b/tools/patman/func_test.py
index 5732c674817..702ec407b7f 100644
--- a/tools/patman/func_test.py
+++ b/tools/patman/func_test.py
@@ -216,10 +216,11 @@ class TestFunctional(unittest.TestCase):
os.remove(cc_file)
lines = iter(out[0].getvalue().splitlines())
- self.assertIn('1 warnings for', next(lines))
+ self.assertIn('1 warning for', next(lines))
self.assertEqual(
- "\t Tag 'Commit-notes' should be before sign-off / Change-Id",
+ "\tTag 'Commit-notes' should be before sign-off / Change-Id",
next(lines))
+ self.assertEqual('', next(lines))
self.assertEqual('Cleaned %s patches' % len(series.commits),
next(lines))
self.assertEqual('Change log missing for v2', next(lines))
diff --git a/tools/patman/patchstream.py b/tools/patman/patchstream.py
index 75b074a0185..b88a546b863 100644
--- a/tools/patman/patchstream.py
+++ b/tools/patman/patchstream.py
@@ -687,12 +687,13 @@ def fix_patches(series, fnames):
cmt.count = count
result = fix_patch(backup_dir, fname, series, cmt)
if result:
- print('%d warnings for %s:' % (len(result), fname))
+ print('%d warning%s for %s:' %
+ (len(result), 's' if len(result) > 1 else '', fname))
for warn in result:
- print('\t', warn)
- print
+ print('\t%s' % warn)
+ print()
count += 1
- print('Cleaned %d patches' % count)
+ print('Cleaned %d patche%s' % (count, 's' if count > 1 else ''))
def insert_cover_letter(fname, series, count):
"""Inserts a cover letter with the required info into patch 0
--
2.29.0.rc2.309.g374f81d7ae-goog
More information about the U-Boot
mailing list