Use pylint 2.7 for depot_tools

This includes a few fixes for specific errors, and disables several new
warnings introduced in this version, in order to allow for an incremental migration.

Bug:1262286
Change-Id: Ie97d686748c9c952e87718a65f401c5f6f80a5c9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3400616
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
This commit is contained in:
Aravind Vasudevan
2022-01-24 21:11:19 +00:00
committed by LUCI CQ
parent 9a4db25b50
commit 22bf605bb6
39 changed files with 343 additions and 277 deletions

View File

@@ -95,31 +95,39 @@ class OwnersFinder(object):
while True:
inp = self.input_command(owner)
if inp == 'y' or inp == 'yes':
if inp in ('y', 'yes'):
self.select_owner(owner)
break
elif inp == 'n' or inp == 'no':
if inp in ('n', 'no'):
self.deselect_owner(owner)
break
elif inp == '' or inp == 'd' or inp == 'defer':
if inp in ('', 'd', 'defer'):
self.owners_queue.append(self.owners_queue.pop(0))
break
elif inp == 'f' or inp == 'files':
if inp in ('f', 'files'):
self.list_files()
break
elif inp == 'o' or inp == 'owners':
if inp in ('o', 'owners'):
self.list_owners(self.owners_queue)
break
elif inp == 'p' or inp == 'pick':
if inp in ('p', 'pick'):
self.pick_owner(gclient_utils.AskForData('Pick an owner: '))
break
elif inp.startswith('p ') or inp.startswith('pick '):
if inp.startswith('p ') or inp.startswith('pick '):
self.pick_owner(inp.split(' ', 2)[1].strip())
break
elif inp == 'r' or inp == 'restart':
if inp in ('r', 'restart'):
self.reset()
break
elif inp == 'q' or inp == 'quit':
if inp in ('q', 'quit'):
# Exit with error
return 1
@@ -268,11 +276,13 @@ class OwnersFinder(object):
self.writeln('You cannot pick ' + self.bold_name(ow) + ' manually. ' +
'It\'s an invalid name or not related to the change list.')
return False
elif ow in self.selected_owners:
if ow in self.selected_owners:
self.writeln('You cannot pick ' + self.bold_name(ow) + ' manually. ' +
'It\'s already selected.')
return False
elif ow in self.deselected_owners:
if ow in self.deselected_owners:
self.writeln('You cannot pick ' + self.bold_name(ow) + ' manually.' +
'It\'s already unselected.')
return False