diff options
author | Eric Boren <borenet@google.com> | 2018-06-22 10:13:52 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-06-22 14:38:28 +0000 |
commit | 5e0909776e81803dd140255fb89fa19e3b8d158f (patch) | |
tree | d848f174fa2744b328d8980a8ed04960e6445f1c /tools | |
parent | 5741a5ba7f369a85cb1f93466cb710bcb0bb49d5 (diff) |
Fix pylint check in presubmit
This fixes the unexpected behavior where we only run pylint over the
affected Python files *unless* there are affected Python files which we
have explicitly blacklisted, in which case we run pylint over ALL Python
files in every subdirectory of the Skia checkout, including repos in
DEPS.
- Added buildtools and common to the blacklist.
- Changed to run pylint over all Python files in Skia, like
presubmit_support expects.
- Fix existing pylint problems.
Bug: skia:
Change-Id: Ife1321f5ae5eaff2a28cc14c99a82a0716c12677
Reviewed-on: https://skia-review.googlesource.com/137126
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Eric Boren <borenet@google.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/copyright/main.py | 2 | ||||
-rwxr-xr-x | tools/jsondiff.py | 10 |
2 files changed, 7 insertions, 5 deletions
diff --git a/tools/copyright/main.py b/tools/copyright/main.py index 24969a7ac5..e428448d21 100644 --- a/tools/copyright/main.py +++ b/tools/copyright/main.py @@ -67,7 +67,7 @@ def GetAllFilepaths(root_directory): @param root_directory root directory within which to find all files """ path_list = [] - for dirpath, dirnames, filenames in os.walk(root_directory): + for dirpath, _, filenames in os.walk(root_directory): for filename in filenames: path_list.append(os.path.abspath(os.path.join(dirpath, filename))) return path_list diff --git a/tools/jsondiff.py b/tools/jsondiff.py index 91e3e4b743..ed4731ad3a 100755 --- a/tools/jsondiff.py +++ b/tools/jsondiff.py @@ -130,7 +130,8 @@ class GMDiffer(object): if results_of_this_type: for test_name in results_of_this_type.keys(): digest_pair = results_of_this_type[test_name] - if digest_pair[0] != gm_json.JSONKEY_HASHTYPE_BITMAP_64BITMD5: + if (digest_pair[0] != + gm_json.JSONKEY_HASHTYPE_BITMAP_64BITMD5): raise ValueError( 'test %s has unsupported hashtype %s' % ( test_name, digest_pair[0])) @@ -138,7 +139,7 @@ class GMDiffer(object): return result_dict def _DictionaryDiff(self, old_dict, new_dict): - """Generate a dictionary showing the diffs between old_dict and new_dict. + """Generate a dictionary showing diffs between old_dict and new_dict. Any entries which are identical across them will be left out.""" diff_dict = {} all_keys = set(old_dict.keys() + new_dict.keys()) @@ -158,8 +159,9 @@ class GMDiffer(object): If newfile is not specified, then 'new' is the actual results within oldfile. """ - return self.GenerateDiffDictFromStrings(self._GetFileContentsAsString(oldfile), - self._GetFileContentsAsString(newfile)) + return self.GenerateDiffDictFromStrings( + self._GetFileContentsAsString(oldfile), + self._GetFileContentsAsString(newfile)) def GenerateDiffDictFromStrings(self, oldjson, newjson=None): """Generate a dictionary showing the diffs: |