fix(tools): force LF line endings in generate_tool_specs.py#4858
Open
gambletan wants to merge 1 commit intocrewAIInc:mainfrom
Open
fix(tools): force LF line endings in generate_tool_specs.py#4858gambletan wants to merge 1 commit intocrewAIInc:mainfrom
gambletan wants to merge 1 commit intocrewAIInc:mainfrom
Conversation
Pass newline="\n" to open() in save_to_json to prevent CRLF on Windows. Also add trailing newline for POSIX convention. Fixes crewAIInc#4737
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
newline="\n"toopen()insave_to_json()so the generatedtool.specs.jsonalways uses LF line endings, regardless of platformProblem
On Windows,
open()in text mode writes\r\n(CRLF) line endings. This causesgenerate_tool_specs.pyto produce atool.specs.jsonwith CRLF, making every line appear modified ingit diffeven when the content hasn't changed.Fix
A one-line change: add
newline="\n"to theopen()call inToolSpecExtractor.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.jsonis written (line endings and trailing newline) without affecting the schema/content generation logic.Overview
Ensures
ToolSpecExtractor.save_to_json()writestool.specs.jsonwith consistent LF line endings on all platforms by opening the file withnewline="\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.