diff mbox series

contrib/mklog.py: Fix issues reported by flake8

Message ID ri6edibkj6n.fsf@suse.cz
State New
Headers show
Series contrib/mklog.py: Fix issues reported by flake8 | expand

Commit Message

Martin Jambor Oct. 3, 2023, 12:02 p.m. UTC
Hi,

the testing infrastructure built by Martin Liška contains checking a
few python scripts in contrib witha tool flake8.  That tool recently
complains that:

  contrib/mklog.py:360:45: E711 comparison to None should be 'if cond is None:'
  contrib/mklog.py:362:1: E305 expected 2 blank lines after class or function definition, found 1

I'd like to silence these with the following, hopefully trivial,
changes.  However, I have only tested the changes by running flake8
again and running ./contrib/mklog.py --help.

Is this good for trunk?  (Or should I stop using flake8 instead?)

Thanks,

Martin


contrib/ChangeLog:

2023-10-03  Martin Jambor  <mjambor@suse.cz>

	* mklog.py (skip_line_in_changelog): Compare to None using is instead
	of ==, add an extra newline after the function.
---
 contrib/mklog.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Jakub Jelinek Oct. 3, 2023, 12:05 p.m. UTC | #1
On Tue, Oct 03, 2023 at 02:02:40PM +0200, Martin Jambor wrote:
> Hi,
> 
> the testing infrastructure built by Martin Liška contains checking a
> few python scripts in contrib witha tool flake8.  That tool recently
> complains that:
> 
>   contrib/mklog.py:360:45: E711 comparison to None should be 'if cond is None:'
>   contrib/mklog.py:362:1: E305 expected 2 blank lines after class or function definition, found 1
> 
> I'd like to silence these with the following, hopefully trivial,
> changes.  However, I have only tested the changes by running flake8
> again and running ./contrib/mklog.py --help.
> 
> Is this good for trunk?  (Or should I stop using flake8 instead?)
> 
> Thanks,
> 
> Martin
> 
> 
> contrib/ChangeLog:
> 
> 2023-10-03  Martin Jambor  <mjambor@suse.cz>
> 
> 	* mklog.py (skip_line_in_changelog): Compare to None using is instead
> 	of ==, add an extra newline after the function.

Ok, thanks.

	Jakub
diff mbox series

Patch

diff --git a/contrib/mklog.py b/contrib/mklog.py
index effe5aa1ca5..1c2c3216e9e 100755
--- a/contrib/mklog.py
+++ b/contrib/mklog.py
@@ -357,7 +357,8 @@  def update_copyright(data):
 
 
 def skip_line_in_changelog(line):
-    return FIRST_LINE_OF_END_RE.match(line) == None
+    return FIRST_LINE_OF_END_RE.match(line) is None
+
 
 if __name__ == '__main__':
     extra_args = os.getenv('GCC_MKLOG_ARGS')