PRESUBMIT: Improve PyLint check and add GN format check.

Add pylintrc file based on
https://code.google.com/p/chromium/codesearch#chromium/src/tools/perf/pylintrc
bit tightened up quite a bit (the one in depot_tools is far
more relaxed).

Remove a few excluded directories from pylint check and fixed/
suppressed all warnings generated.

Add GN format check + formatted all GN files using 'gn format'.
Cleanup redundant rules in tools/PRESUBMIT.py

TESTED=Ran 'git cl presubmit -vv', fixed the PyLint violations.
Ran it again with a modification in webrtc/build/webrtc.gni, formatted
all the GN files and ran it again.

R=henrika@webrtc.org, phoglund@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/50069004

Cr-Commit-Position: refs/heads/master@{#9274}
This commit is contained in:
Henrik Kjellander
2015-05-25 12:55:39 +02:00
parent 00aac5aacf
commit 57e5fd2e60
40 changed files with 299 additions and 280 deletions

View File

@ -171,7 +171,7 @@ class Remove(Action):
else:
log('Removing %s: %s', filesystem_type, self._path)
def doit(self, _links_db):
def doit(self, _):
os.remove(self._path)
@ -187,7 +187,7 @@ class Rmtree(Action):
else:
logging.warn('Removing directory: %s', self._path)
def doit(self, _links_db):
def doit(self, _):
if sys.platform.startswith('win'):
# shutil.rmtree() doesn't work on Windows if any of the directories are
# read-only, which svn repositories are.
@ -202,7 +202,7 @@ class Makedirs(Action):
self._priority = 1
self._path = path
def doit(self, _links_db):
def doit(self, _):
try:
os.makedirs(self._path)
except OSError as e:
@ -258,7 +258,7 @@ if sys.platform.startswith('win'):
os.symlink = symlink
class WebRTCLinkSetup():
class WebRTCLinkSetup(object):
def __init__(self, links_db, force=False, dry_run=False, prompt=False):
self._force = force
self._dry_run = dry_run
@ -482,7 +482,7 @@ def main():
logging.error('On Windows, you now need to have administrator '
'privileges for the shell running %s (or '
'`gclient sync|runhooks`).\nPlease start another command '
'prompt as Administrator and try again.' % sys.argv[0])
'prompt as Administrator and try again.', sys.argv[0])
return 1
if not os.path.exists(CHROMIUM_CHECKOUT):