fix: add trailing newline to init-options.json output#3509
Merged
mnriem merged 1 commit intoJul 14, 2026
Conversation
`save_init_options()` omitted a final newline, causing `end-of-file-fixer` from .pre-commit-config.yaml (github#3430) to flag a diff on every `specify integration upgrade` run. Append `\n` to the `json.dumps()` output to match POSIX expectations and align with `integration_state.py` which already includes the trailing newline. Ref: github#3430
init-options.json output
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a formatting issue in Specify CLI’s persisted init-options output by ensuring .specify/init-options.json is written with a trailing newline, preventing end-of-file-fixer (from the repo’s pre-commit hooks) from repeatedly producing “dirty” diffs after integration operations.
Changes:
- Append
"\n"to thejson.dumps(...)output insave_init_options()so the generated JSON file ends with a newline. - Align
init-options.jsonwriting behavior with existing JSON state writing (e.g.,.specify/integration.jsonalready includes a trailing newline).
Show a summary per file
| File | Description |
|---|---|
src/specify_cli/_init_options.py |
Adds a trailing newline when persisting .specify/init-options.json to avoid perpetual pre-commit EOF diffs. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Low
Collaborator
|
Thank you! |
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.
Description
save_init_options()insrc/specify_cli/_init_options.pyomitted a trailing newline when writinginit-options.json. This causedend-of-file-fixerfrom.pre-commit-config.yaml(#3430) to flag a dirty diff on everyspecify integration upgraderun.Appends
"\n"to thejson.dumps()output to match POSIX file conventions — consistent withintegration_state.py:252which already includes the trailing newline:\n?_init_options.py:17integration_state.py:252Ref: #3430
Testing
uv run specify --helpuv sync --all-extras && uv run pytest—3986 passed, 110 skipped in 129.71s (0:02:09)vincentclee/spec-kit-test(main= v0.12.14 baseline,fix/init-options-trailing-newline= verified fix —pre-commit run --all-filespasses clean). See each branch's README for full reproduction steps.AI Disclosure
GitHub Copilot CLI agent (model: claude-opus-4.6, high) identified the bug, applied the fix, and ran the test suite.