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

Remove extra newline from N-Triples output #1999

Merged
merged 2 commits into from
Jun 24, 2022

Conversation

tcmitchell
Copy link
Contributor

Remove the extra newline generated by the N-Triples serializer and add
a unit test to verify that N-Triples output does not end in two
consecutive newlines.

Closes #1998

Summary of changes

This pull request removes the extra newline that the N-Triples serializers add. This pull request also includes a unit test to verify that the output from the N-Triples serializers ("nt" and "nt11") does not end in two consecutive newlines.

See issue #1998 for additional details and a reproducible example. This reproducible example is used in the added unit test.

This fix does not change any APIs so it should be backward compatible.

Checklist

  • [ x] Checked that there aren't other open pull requests for
    the same change.
  • [ x] Added tests for any changes that have a runtime impact.
  • [ x] Checked that all tests and type checking passes.
  • [ x] Considered granting push permissions to the PR branch,
    so maintainers can fix minor issues and keep your PR up to date.

Remove the extra newline generated by the N-Triples serializer and add
a unit test to verify that N-Triples output does not end in two
consecutive newlines.
Copy link
Member

@aucampia aucampia left a comment

Choose a reason for hiding this comment

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

LGMT, I don't really see a good reason to have multiple newlines either. Will see what others say though.

@aucampia aucampia requested a review from a team June 23, 2022 19:00
@coveralls
Copy link

Coverage Status

Coverage remained the same at 88.556% when pulling 9842e1e on tcmitchell:1998-ntriples-newlines into 05dced2 on RDFLib:master.

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

LGTM, there's only one instance of trailing newline in the test suite (for i in *.nt; do tail -2 ${i} | grep -H -n ^$ ; done) and it's explicitly described as such:

cat nt-syntax-file-03.nt
#One comment, one empty line.

@aucampia aucampia merged commit eabab5f into RDFLib:master Jun 24, 2022
@aucampia
Copy link
Member

Thanks for contributing @tcmitchell

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.

N-Triples serializer adds extra newline
3 participants