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

Prevent amalgamate.py from adding trailing whitespace #272

Merged
merged 1 commit into from
Oct 24, 2024

Conversation

jwakely
Copy link
Contributor

@jwakely jwakely commented Oct 24, 2024

When adding the license text, only add leading whitespace to non-empty lines, otherwise it becomes trailing whitespace.

Tested with each --license option to verify the only changes in the generated output are removing the unwanted trailing whitespace.

When adding the license text, only add leading whitespace to non-empty
lines, otherwise it becomes trailing whitespace.
Comment on lines +31 to +33
if len(line):
line = ' ' + line
text += '//' + line + '\n'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Or if you prefer:

Suggested change
if len(line):
line = ' ' + line
text += '//' + line + '\n'
if len(line):
text += '// ' + line + '\n'
else:
text += '//\n'

@lemire
Copy link
Member

lemire commented Oct 24, 2024

Makes sense to me. Merging.

@lemire lemire merged commit 7665574 into fastfloat:main Oct 24, 2024
39 checks passed
@jwakely jwakely deleted the trailing-whitespace branch October 24, 2024 20:45
@jwakely
Copy link
Contributor Author

jwakely commented Oct 24, 2024

Thanks!

@lemire
Copy link
Member

lemire commented Oct 24, 2024

Thanks to you !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants