From a71add409c4f15e58aa99fbd443b9e0bb2737123 Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Sat, 28 Aug 2021 00:30:41 +0200 Subject: [PATCH] pylint: enable consider-using-in Signed-off-by: Johannes Berg Reviewed-by: Rob Browning Tested-by: Rob Browning --- .pylintrc | 1 + lib/bup/cmd/ftp.py | 2 +- lib/bup/shquote.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.pylintrc b/.pylintrc index 1b6370b..f7c5f60 100644 --- a/.pylintrc +++ b/.pylintrc @@ -3,6 +3,7 @@ [MESSAGES CONTROL] disable=all enable= + consider-using-in, return-in-init, trailing-whitespace, unused-import, diff --git a/lib/bup/cmd/ftp.py b/lib/bup/cmd/ftp.py index 33fd804..4694dd9 100755 --- a/lib/bup/cmd/ftp.py +++ b/lib/bup/cmd/ftp.py @@ -226,7 +226,7 @@ def main(argv): with open(name, 'wb') as destfile: log('Saving %s\n' % path_msg(name)) write_to_file(srcfile, destfile) - elif cmd == b'help' or cmd == b'?': + elif cmd in (b'help', b'?'): out.write(b'Commands: ls cd pwd cat get mget help quit\n') out.flush() elif cmd in (b'quit', b'exit', b'bye'): diff --git a/lib/bup/shquote.py b/lib/bup/shquote.py index 829f3f3..ed070c5 100644 --- a/lib/bup/shquote.py +++ b/lib/bup/shquote.py @@ -32,7 +32,7 @@ def _quotesplit(line): yield (wordstart, word) word = b'' wordstart = i+1 - elif not inquote and not word and (c == q or c == qq): + elif not inquote and not word and c in (q, qq): # the 'not word' constraint on this is un-sh-like, but do it # for sanity when autocompleting inquote = c -- 2.39.2