patman: Define Commit.path in the constructor

It is good practice to init all variables in the constructor and pylint
sometimes checks this. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reported-by: Tom Rini <trini@konsulko.com>
This commit is contained in:
Simon Glass 2022-03-02 19:12:24 -07:00
parent 79e1d289b7
commit 04fce6ff70

View file

@ -28,6 +28,7 @@ class Commit:
key: rtag type (e.g. 'Reviewed-by') key: rtag type (e.g. 'Reviewed-by')
value: Set of people who gave that rtag, each a name/email string value: Set of people who gave that rtag, each a name/email string
warn: List of warnings for this commit, each a str warn: List of warnings for this commit, each a str
patch (str): Filename of the patch file for this commit
""" """
def __init__(self, hash): def __init__(self, hash):
self.hash = hash self.hash = hash
@ -40,6 +41,7 @@ class Commit:
self.change_id = None self.change_id = None
self.rtags = collections.defaultdict(set) self.rtags = collections.defaultdict(set)
self.warn = [] self.warn = []
self.patch = ''
def __str__(self): def __str__(self):
return self.subject return self.subject