mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
chore: fix formatting of a few Python files (#20778)
This commit is contained in:
committed by
John Kleinschmidt
parent
a8e7696674
commit
cff63d32a0
@@ -49,7 +49,8 @@ def hasTrailingWhiteSpace(filepath, fix):
|
||||
for num, line in enumerate(lines):
|
||||
fixed_lines.append(line.rstrip() + '\n')
|
||||
if not fix and line != line.rstrip():
|
||||
print("Trailing whitespace on line {} in file: {}".format(num + 1, filepath))
|
||||
print("Trailing whitespace on line {} in file: {}".format(
|
||||
num + 1, filepath))
|
||||
return True
|
||||
if fix:
|
||||
with open(filepath, 'w') as f:
|
||||
|
||||
@@ -8,7 +8,8 @@ def read_patch(patch_dir, patch_filename):
|
||||
"""Read a patch from |patch_dir/filename| and amend the commit message with
|
||||
metadata about the patch file it came from."""
|
||||
ret = []
|
||||
with codecs.open(os.path.join(patch_dir, patch_filename), encoding='utf-8') as f:
|
||||
patch_path = os.path.join(patch_dir, patch_filename)
|
||||
with codecs.open(patch_path, encoding='utf-8') as f:
|
||||
for l in f.readlines():
|
||||
if l.startswith('diff -'):
|
||||
ret.append('Patch-Filename: {}\n'.format(patch_filename))
|
||||
|
||||
Reference in New Issue
Block a user