Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure trailing newline is written to files and stdout (#879)
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 <!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] Documentation only change - [x] 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 <!--- Go over all the following points, and put an `x` in all the boxes that apply. --> <!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> - [x] 📖 - My change doesn't require a documentation update, or ... - it _does_ and I have updated it - [x] ⚖️ - The contribution will be subject to [The MIT license](https://github.com/sverweij/dependency-cruiser/blob/main/LICENSE), and I'm OK with that. - The contribution is my own original work. - I am ok with the stuff in [**CONTRIBUTING.md**](https://github.com/sverweij/dependency-cruiser/blob/main/.github/CONTRIBUTING.md).
- Loading branch information