[PATCH 4/9] patman: fix test_indent test
Maxim Cournoyer
maxim.cournoyer at gmail.com
Mon Dec 19 02:59:17 CET 2022
The checkpatch.pl script indentation check now checks that lines start
with tabs an complains otherwise, so to make the test fail, start a
line with spaces. This is now also emitted as a warning rather than
as a check.
Signed-off-by: Maxim Cournoyer <maxim.cournoyer at savoirfairelinux.com>
---
tools/patman/test_checkpatch.py | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/tools/patman/test_checkpatch.py b/tools/patman/test_checkpatch.py
index 8960cd505f..bd53ae3ca5 100644
--- a/tools/patman/test_checkpatch.py
+++ b/tools/patman/test_checkpatch.py
@@ -4,6 +4,7 @@
# Tests for U-Boot-specific checkpatch.pl features
#
# Copyright (c) 2011 The Chromium OS Authors.
+# Copyright (c) 2022 Maxim Cournoyer <maxim.cournoyer at savoirfairelinux.com>
#
import os
@@ -257,7 +258,7 @@ index 0000000..2234c87
+ rec->name = name;
+ }
+ if (!rec->name &&
-+ %ssomething_else) {
++%ssomething_else) {
+ rec->time_us = (u32)timer_get_us();
+ rec->name = name;
+ }
@@ -269,7 +270,7 @@ index 0000000..2234c87
signoff = 'Signed-off-by: Simon Glass <sjg at chromium.org>\n'
license = '// SPDX-License-Identifier: GPL-2.0+'
tab = ' '
- indent = ' '
+ indent = tab
if data_type == 'good':
pass
elif data_type == 'no-signoff':
@@ -279,7 +280,7 @@ index 0000000..2234c87
elif data_type == 'spaces':
tab = ' '
elif data_type == 'indent':
- indent = tab
+ indent = ' ' # must use tabs, not spaces!
else:
print('not implemented')
return data % (signoff, license, tab, indent, tab)
@@ -343,8 +344,8 @@ index 0000000..2234c87
self.assertEqual(result.ok, False)
self.assertEqual(len(result.problems), 1)
self.assertEqual(result.errors, 0)
- self.assertEqual(result.warnings, 0)
- self.assertEqual(result.checks, 1)
+ self.assertEqual(result.warnings, 1)
+ self.assertEqual(result.checks, 0)
self.assertEqual(result.lines, 62)
os.remove(inf)
--
2.38.1
More information about the U-Boot
mailing list