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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure trailing newline is written to files and stdout #879

Conversation

martinslota
Copy link
Contributor

@martinslota martinslota commented Nov 28, 2023

Ensure that a trailing newline is written to files and stdout.

Description

When writing non-binary output, ensure that a trailing newline is written to files and stdout.

Motivation and Context

It would be nice to have a trailing newline in the .dependency-cruiser-known-violations.json file generated by depcruise-baseline for less friction when the file is subsequently consumed by other tools. I believe that something similar applies to other report files generated by dependency cruiser.

How Has This Been Tested?

I ran depcruise-baseline as a manual test and verified that an additional line feed character gets added to the generated file as a result of this change.

I could look into adding an automated test for that, but I have not done that so far. Please let me know in case it is desired.

One of the existing test files needed to be adapted to capture this change, so in that sense it is somewhat covered by existing unit tests.

  • green ci

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • Documentation only change
  • Refactor (non-breaking change which fixes an issue without changing functionality)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • 馃摉

    • My change doesn't require a documentation update, or ...
    • it does and I have updated it
  • 鈿栵笍

    • The contribution will be subject to The MIT license, and I'm OK with that.
    • The contribution is my own original work.
    • I am ok with the stuff in CONTRIBUTING.md.

Copy link

codeclimate bot commented Nov 28, 2023

Code Climate has analyzed commit b101114 and detected 0 issues on this pull request.

View more on Code Climate.

@martinslota martinslota marked this pull request as ready for review November 28, 2023 20:39
@martinslota
Copy link
Contributor Author

In my view the change doesn't need to be documented, so I checked off that tick box.

@sverweij sverweij merged commit 17c7e1c into sverweij:main Dec 1, 2023
8 checks passed
@martinslota martinslota deleted the ensure-trailing-newline-is-written-to-files-and-stdout branch December 1, 2023 15:02
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.

None yet

2 participants