diff options
author | Caroline Tice <cmtice@google.com> | 2017-04-06 17:16:05 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-04-08 19:40:20 -0700 |
commit | f6ef4395fe1896ba68c80e52cb24763b0fcfe7f8 (patch) | |
tree | 7612123711db98f0746e56b66368d16b388192bd /verify_compiler.py | |
parent | 8c18be1425c8a4ecfc059a7c637fc93f33edab1f (diff) | |
download | toolchain-utils-f6ef4395fe1896ba68c80e52cb24763b0fcfe7f8.tar.gz |
[toolchain-utils] Fix remaining lint errors in toolchain-utils.
In addition to fixing the lint errors, this also fixes the Python
formatting issues (ran tc_pyformat on nearly all the files).
BUG=chromium:570450
TEST=Ran all crosperf & bisect tool unit tests.
Ran afe_lock_machine.py (check machine status)
Ran full crosperf test (octane, speedometer, BootPerf) on alex.
Change-Id: Ic86f9192801ac67769f3de30f1c5f0d203ce0831
Reviewed-on: https://chromium-review.googlesource.com/471886
Commit-Ready: Caroline Tice <cmtice@chromium.org>
Tested-by: Caroline Tice <cmtice@chromium.org>
Reviewed-by: Manoj Gupta <manojgupta@chromium.org>
Diffstat (limited to 'verify_compiler.py')
-rwxr-xr-x | verify_compiler.py | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/verify_compiler.py b/verify_compiler.py index 9eafbb8a..b70c1257 100755 --- a/verify_compiler.py +++ b/verify_compiler.py @@ -34,13 +34,13 @@ def CreateTmpDwarfFile(filename, dwarf_file, cmd_executer): return retval -def FindAllFiles(root_dir, cmd_executer): +def FindAllFiles(root_dir): """Create a list of all the *.debug and *.dwp files to be checked.""" file_list = [] tmp_list = [ os.path.join(dirpath, f) - for dirpath, dirnames, files in os.walk(root_dir) + for dirpath, _, files in os.walk(root_dir) for f in fnmatch.filter(files, '*.debug') ] for f in tmp_list: @@ -48,7 +48,7 @@ def FindAllFiles(root_dir, cmd_executer): file_list.append(f) tmp_list = [ os.path.join(dirpath, f) - for dirpath, dirnames, files in os.walk(root_dir) + for dirpath, _, files in os.walk(root_dir) for f in fnmatch.filter(files, '*.dwp') ] file_list += tmp_list @@ -99,8 +99,8 @@ def CheckFile(filename, compiler, tmp_dir, options, cmd_executer): status = CreateTmpDwarfFile(filename, dwarf_file, cmd_executer) if status != 0: - print('Unable to create dwarf file for %s (status: %d).' % - (filename, status)) + print('Unable to create dwarf file for %s (status: %d).' % (filename, + status)) return status comp_str = COMPILER_STRINGS[compiler] @@ -121,8 +121,8 @@ def CheckFile(filename, compiler, tmp_dir, options, cmd_executer): if 'DW_AT_name' in line: words = line.split(':') bad_file = words[-1] - print('FAIL: %s was not compiled with %s.' % - (bad_file.rstrip(), compiler)) + print('FAIL: %s was not compiled with %s.' % (bad_file.rstrip(), + compiler)) looking_for_name = False elif 'DW_TAG_' in line: looking_for_name = False @@ -189,7 +189,7 @@ def Main(argv): if filename: file_list.append(filename) else: - file_list = FindAllFiles(root_dir, cmd_executer) + file_list = FindAllFiles(root_dir) bad_files = [] unknown_files = [] @@ -222,9 +222,8 @@ def Main(argv): for f in bad_files: print(f) if len(unknown_files) > 0: - print( - '\n\nUnable to verify the following files (no debug info in them):\n' - ) + print('\n\nUnable to verify the following files (no debug info in ' + 'them):\n') for f in unknown_files: print(f) return 1 |