Skip to content

fix(tools): use LF line endings in generate_tool_specs.py to prevent CRLF diffs on Windows#4979

Open
NIK-TIGER-BILL wants to merge 1 commit intocrewAIInc:mainfrom
NIK-TIGER-BILL:fix/tool-specs-crlf-line-endings
Open

fix(tools): use LF line endings in generate_tool_specs.py to prevent CRLF diffs on Windows#4979
NIK-TIGER-BILL wants to merge 1 commit intocrewAIInc:mainfrom
NIK-TIGER-BILL:fix/tool-specs-crlf-line-endings

Conversation

@NIK-TIGER-BILL
Copy link

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

Fix: add newline="\n" to the open() call in save_to_json() to force LF output on all platforms.

Closes #4737

Python's open() in text mode uses OS-native line endings. On Windows
this produces CRLF, making every line in tool.specs.json appear changed
in git diff even when no logical content changed.

Fix: pass newline="\n" to open() so the output always uses LF,
matching the committed file and eliminating spurious diffs.

Closes 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