Skip to content

Provide an 'auto' option for --line_terminator #2426

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

Conversation

hzeller
Copy link
Collaborator

@hzeller hzeller commented Jun 3, 2025

If 'auto' is chosen, output CRLF line endings if more than 50% of the input is CRLF, otherwise LF.

The other choicese, CRLF or LF, behave as before.

NB: The default changes with this change: previously, we always converted a CRLF input to LF, now the default is 'auto'

@hzeller hzeller requested a review from IEncinas10 June 3, 2025 22:06
@hzeller hzeller force-pushed the feature-20250603-line-format-auto branch 2 times, most recently from f4b46cf to 4719e14 Compare June 4, 2025 06:19
@hzeller
Copy link
Collaborator Author

hzeller commented Jun 4, 2025

I still need to write a test for GuessLineTerminator(), but the rest can already be reviewed.

Copy link
Collaborator

@IEncinas10 IEncinas10 left a comment

Choose a reason for hiding this comment

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

Thanks for the improvement Henner! I don't have any significant comment, LGTM :)

@hzeller hzeller force-pushed the feature-20250603-line-format-auto branch 2 times, most recently from d0d5f68 to ad9707d Compare June 4, 2025 15:50
@hzeller
Copy link
Collaborator Author

hzeller commented Jun 4, 2025

I still need to write a test for GuessLineTerminator(), but the rest can already be reviewed.

Also added that test now.
Will merge once CI finishes green.

If 'auto' is chosen, output CRLF line endings if more than 50% of the
input is CRLF, otherwise LF.

The other choices, CRLF or LF, behave as before.

NB: The default changes with this change: previously, we always
converted a CRLF input to LF, now the default is 'auto'

Issues: chipsalliance#2424 chipsalliance#2370
@hzeller hzeller force-pushed the feature-20250603-line-format-auto branch from ad9707d to 4f9313d Compare June 4, 2025 16:34
@hzeller hzeller merged commit fb69b42 into chipsalliance:master Jun 4, 2025
33 checks passed
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