Skip to content

fix(tools): force LF line endings in generate_tool_specs.py#4858

Open
gambletan wants to merge 1 commit intocrewAIInc:mainfrom
gambletan:fix/generate-tool-specs-lf-newlines
Open

fix(tools): force LF line endings in generate_tool_specs.py#4858
gambletan wants to merge 1 commit intocrewAIInc:mainfrom
gambletan:fix/generate-tool-specs-lf-newlines

Conversation

@gambletan
Copy link

@gambletan gambletan commented Mar 14, 2026

Summary

  • Pass newline="\n" to open() in save_to_json() so the generated tool.specs.json always uses LF line endings, regardless of platform
  • Add a trailing newline to the JSON output for POSIX convention

Problem

On Windows, open() in text mode writes \r\n (CRLF) line endings. This causes generate_tool_specs.py to produce a tool.specs.json with CRLF, making every line appear modified in git diff even when the content hasn't changed.

Fix

A one-line change: add newline="\n" to the open() call in ToolSpecExtractor.save_to_json(). This forces LF line endings on all platforms.

Fixes #4737

🤖 Generated with Claude Code


Note

Low Risk
Low risk: changes only how tool.specs.json is written (line endings and trailing newline) without affecting the schema/content generation logic.

Overview
Ensures ToolSpecExtractor.save_to_json() writes tool.specs.json with consistent LF line endings on all platforms by opening the file with newline="\n".

Also appends a trailing newline after json.dump(...) to follow POSIX conventions and reduce noisy diffs.

Written by Cursor Bugbot for commit 602e4fd. This will update automatically on new commits. Configure here.

Pass newline="\n" to open() in save_to_json to prevent CRLF on Windows.
Also add trailing newline for POSIX convention.

Fixes crewAIInc#4737
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.

[BUG] generate_tool_specs.py writes CRLF on Windows, causing spurious diffs

1 participant