Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix formatting of a few Python files #20778

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion script/check-trailing-whitespace.py
Expand Up @@ -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:
Expand Down
3 changes: 2 additions & 1 deletion script/lib/patches.py
Expand Up @@ -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))
Expand Down