Skip to content

Fix indentation in default devbox config#2851

Open
humtta wants to merge 1 commit into
jetify-com:mainfrom
humtta-forks:fix/default-config-json-indentation
Open

Fix indentation in default devbox config#2851
humtta wants to merge 1 commit into
jetify-com:mainfrom
humtta-forks:fix/default-config-json-indentation

Conversation

@humtta
Copy link
Copy Markdown

@humtta humtta commented Jun 6, 2026

Summary

DefaultConfig() defines the default configuration using a raw string literal directly in the function body. Because raw string literals in Go preserve all whitespace, the resulting JSON ends up with extra leading spaces on almost every line.

This fix extracts the template into a package-level const, so the string starts at column zero and the resulting JSON is well-formed.

devbox.json before the change:

{␊
····"$schema":·"https://raw.githubusercontent.com/jetify-com/devbox/main/.schema/devbox.schema.json",␊
····"packages":·[],␊
····"shell":·{␊
······"init_hook":·[␊
········"echo·'Welcome·to·devbox!'·>·/dev/null"␊
······],␊
······"scripts":·{␊
········"test":·[␊
··········"echo·\"Error:·no·test·specified\"·&&·exit·1"␊
········]␊
······}␊
····}␊
··}␊
··

devbox.json after the change:

{␊
··"$schema":·"https://raw.githubusercontent.com/jetify-com/devbox/main/.schema/devbox.schema.json",␊
··"packages":·[],␊
··"shell":·{␊
····"init_hook":·[␊
······"echo·'Welcome·to·devbox!'·>·/dev/null"␊
····],␊
····"scripts":·{␊
······"test":·[␊
········"echo·\"Error:·no·test·specified\"·&&·exit·1"␊
······]␊
····}␊
··}␊
}␊

How was it tested?

Ran devbox init locally and inspected the generated devbox.json before and after the change.

Community Contribution License

All community contributions in this pull request are licensed to the project maintainers under the terms of the Apache 2 License.

By creating this pull request, I represent that I have the right to license the contributions to the project maintainers under the Apache 2 License as stated in the Community Contribution License.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants