Skip to content

Conversation

@matiasdaloia
Copy link
Collaborator

@matiasdaloia matiasdaloia commented Nov 14, 2025

Summary by CodeRabbit

  • Bug Fixes
    • Fixed JSON file formatting to include proper trailing newlines, ensuring compliance with POSIX text file standards and improved file consistency across different systems.

@matiasdaloia matiasdaloia self-assigned this Nov 14, 2025
@matiasdaloia matiasdaloia linked an issue Nov 14, 2025 that may be closed by this pull request
@matiasdaloia matiasdaloia added the bug Something isn't working label Nov 14, 2025
@coderabbitai
Copy link

coderabbitai bot commented Nov 14, 2025

Walkthrough

The pull request adds a trailing newline to JSON file serialization to comply with POSIX text file standards. The JSONSerialize function is modified to append a newline character after marshaling JSON output, and the changelog is updated to document this fix for issue #127.

Changes

Cohort / File(s) Change Summary
Changelog
CHANGELOG.md
Added [0.9.7] entry documenting the fix to ensure trailing newline in .json files per POSIX standards (issue #127)
JSON Serialization
internal/utils/file_utils_default_impl.go
Modified JSONSerialize function to append a newline character to serialized JSON output before returning

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

This is a straightforward, localized change with minimal logic complexity—a single string append operation in one function and a corresponding changelog entry.

Poem

🐰 A newline hops in, so neat and so spry,
JSON files now end with a POSIX goodbye,
No more complaints from the standards so strict,
Just one tiny character—perfectly picked! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title accurately describes the main change: adding a trailing newline when saving JSON files, which aligns with the modifications to JSONSerialize and the CHANGELOG entry.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 127-missing-newline-on-scanossjson

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3ae22b3 and abc73e8.

📒 Files selected for processing (2)
  • CHANGELOG.md (1 hunks)
  • internal/utils/file_utils_default_impl.go (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build
🔇 Additional comments (2)
CHANGELOG.md (1)

10-13: LGTM! Changelog entry is well-formatted.

The changelog entry correctly documents the fix, follows Keep a Changelog conventions, and properly references the issue.

internal/utils/file_utils_default_impl.go (1)

93-95: LGTM! Clean implementation of POSIX-compliant JSON serialization.

The implementation correctly appends a trailing newline to JSON output. This is a common practice that ensures files end with a newline character as expected by POSIX text file standards and many development tools.

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.5.0)

Error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions
The command is terminated due to an error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

SCANOSS SCAN Completed 🚀

  • Detected components: 3
  • Undeclared components: 0
  • Declared components: 3
  • Detected files: 184
  • Detected files undeclared: 0
  • Detected files declared: 184
  • Licenses detected: 2
  • Licenses detected with copyleft: 1
  • Policies: ✅ 1 pass (1 total)

View more details on SCANOSS Action Summary

@matiasdaloia matiasdaloia merged commit 8ac8704 into main Nov 14, 2025
7 checks passed
@matiasdaloia matiasdaloia deleted the 127-missing-newline-on-scanossjson branch November 14, 2025 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing newline on scanoss.json

2 participants