Skip to content

Auto removal of trailing whitespace to skip binary file correctly #13

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

Merged
merged 6 commits into from
May 19, 2021

Conversation

siong-chin
Copy link
Contributor

Also give useful output

NO_JIRA

@@ -377,7 +377,7 @@ def trim_trailing_whitespace_in_file(filename, new_file, dry_run,
with open(filename, 'rb') as fileobj:
lines = fileobj.read().decode().splitlines(True)
except UnicodeDecodeError:
return
return 0

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest adding a test for this case

@siong-chin siong-chin merged commit 3a10454 into main May 19, 2021
@siong-chin siong-chin deleted the fix_trailing_whitespace_removal branch May 19, 2021 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants