diff mbox series

[v2,22/30] patman: Fix spelling of plural for warning

Message ID 20201026010442.1606893-23-sjg@chromium.org
State Superseded
Delegated to: Simon Glass
Headers show
Series patman: Collect review tags and comments from Patchwork | expand

Commit Message

Simon Glass Oct. 26, 2020, 1:04 a.m. UTC
Tidy up the extra 's' when there is only a single warning. Fix the empty
print statement also.

Signed-off-by: Simon Glass <sjg@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 mbox series

Patch

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