From 04f7870635dff90ddc1b8465b5b8304c2d429a92 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 29 May 2017 15:31:26 -0600 Subject: patman: Don't report unicode character Unicode characters may appear in input patches so we should not warn about them. Drop this warning. Signed-off-by: Simon Glass Tested-by: Philipp Tomsich --- tools/patman/patchstream.py | 9 --------- 1 file changed, 9 deletions(-) (limited to 'tools/patman/patchstream.py') diff --git a/tools/patman/patchstream.py b/tools/patman/patchstream.py index cd4667f61ce..324c65442f4 100644 --- a/tools/patman/patchstream.py +++ b/tools/patman/patchstream.py @@ -308,15 +308,6 @@ class PatchStream: # Well that means this is an ordinary line else: - pos = 1 - # Look for ugly ASCII characters - for ch in line: - # TODO: Would be nicer to report source filename and line - if ord(ch) > 0x80: - self.warn.append("Line %d/%d ('%s') has funny ascii char" % - (self.linenum, pos, line)) - pos += 1 - # Look for space before tab m = re_space_before_tab.match(line) if m: -- cgit v1.2.3 From db116cc8d095ec499ae748ea864fa0def54ca3d6 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 29 May 2017 15:31:27 -0600 Subject: patman: Don't return the series in FixPatches() There is no need for this function to return the same object that was passed in. Drop the return value. Signed-off-by: Simon Glass Tested-by: Philipp Tomsich --- tools/patman/patchstream.py | 1 - 1 file changed, 1 deletion(-) (limited to 'tools/patman/patchstream.py') diff --git a/tools/patman/patchstream.py b/tools/patman/patchstream.py index 324c65442f4..6098728aa11 100644 --- a/tools/patman/patchstream.py +++ b/tools/patman/patchstream.py @@ -477,7 +477,6 @@ def FixPatches(series, fnames): print count += 1 print('Cleaned %d patches' % count) - return series def InsertCoverLetter(fname, series, count): """Inserts a cover letter with the required info into patch 0 -- cgit v1.2.3 From 6e87ae1c0730ec99b6824c2a3dc8510813f92b98 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 29 May 2017 15:31:31 -0600 Subject: patman: Add a functional test The existing test (patman --test) only covers basic checkpatch output. We have had some problems with unicode processing and could use test coverage for the various tags patman supports. Add a new functional test which runs most of the patman flow on a few test commits and checks that the results are correct. See the documentation in the test for a description of what it does. Signed-off-by: Simon Glass Tested-by: Philipp Tomsich --- tools/patman/patchstream.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'tools/patman/patchstream.py') diff --git a/tools/patman/patchstream.py b/tools/patman/patchstream.py index 6098728aa11..1b9136aa5c2 100644 --- a/tools/patman/patchstream.py +++ b/tools/patman/patchstream.py @@ -424,6 +424,19 @@ def GetMetaData(start, count): """ return GetMetaDataForList('HEAD~%d' % start, None, count) +def GetMetaDataForTest(text): + """Process metadata from a file containing a git log. Used for tests + + Args: + text: + """ + series = Series() + ps = PatchStream(series, is_log=True) + for line in text.splitlines(): + ps.ProcessLine(line) + ps.Finalize() + return series + def FixPatch(backup_dir, fname, series, commit): """Fix up a patch file, by adding/removing as required. -- cgit v1.2.3