Message ID | 20220302191215.1.Iaf1f3db1de7b45106207a284c6b8076de88c4cea@changeid |
---|---|
State | Accepted |
Commit | 04fce6ff705c455241a180495043c8cd4c4ad81e |
Delegated to: | Simon Glass |
Headers | show |
Series | patman: Define Commit.path in the constructor | expand |
On Wed, 2 Mar 2022 at 19:12, Simon Glass <sjg@chromium.org> wrote: > > 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> > --- > Example here: > > https://dev.azure.com/u-boot/u-boot/_build/results?buildId=3733&view=logs > &j=b31543ba-bf3a-552c-25a8-2f4df22f9328&t=093e08d5-0fd9-5b91-9d3b-fd9f41aee005 > > tools/patman/commit.py | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/tools/patman/commit.py b/tools/patman/commit.py > index a645b22d08..9537de43d3 100644 > --- a/tools/patman/commit.py > +++ b/tools/patman/commit.py > @@ -28,6 +28,7 @@ class Commit: > key: rtag type (e.g. 'Reviewed-by') > value: Set of people who gave that rtag, each a name/email string > warn: List of warnings for this commit, each a str > + patch (str): Filename of the patch file for this commit > """ > def __init__(self, hash): > self.hash = hash > @@ -40,6 +41,7 @@ class Commit: > self.change_id = None > self.rtags = collections.defaultdict(set) > self.warn = [] > + self.patch = '' > > def __str__(self): > return self.subject > -- > 2.35.1.574.g5d30c73bfb-goog >
On Wed, Mar 02, 2022 at 07:12:24PM -0700, Simon Glass wrote: > 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> Applied to u-boot/next, thanks!
diff --git a/tools/patman/commit.py b/tools/patman/commit.py index a645b22d08..9537de43d3 100644 --- a/tools/patman/commit.py +++ b/tools/patman/commit.py @@ -28,6 +28,7 @@ class Commit: key: rtag type (e.g. 'Reviewed-by') value: Set of people who gave that rtag, each a name/email string warn: List of warnings for this commit, each a str + patch (str): Filename of the patch file for this commit """ def __init__(self, hash): self.hash = hash @@ -40,6 +41,7 @@ class Commit: self.change_id = None self.rtags = collections.defaultdict(set) self.warn = [] + self.patch = '' def __str__(self): return self.subject
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> --- Example here: https://dev.azure.com/u-boot/u-boot/_build/results?buildId=3733&view=logs &j=b31543ba-bf3a-552c-25a8-2f4df22f9328&t=093e08d5-0fd9-5b91-9d3b-fd9f41aee005 tools/patman/commit.py | 2 ++ 1 file changed, 2 insertions(+)