Repository navigation
fix(init): write .gitignore for the go template - #2833
Merged
Merged
Conversation
…tries An existing .gitignore init cannot read now warns instead of failing an init that has already written the app. The entry check also accepts **/dir, dir/* and dir/**. The getting-started file table gains the .gitignore row in the remaining 12 locales.
|
The |
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
nsgo init -template go, the default template, wrote no.gitignore, although a Go app gets.nsgo/(development builds, automation sessions with their token, test builds and screenshots, the check lock) anddist/fromnsgo buildexactly as a TSX app does. A firstgit add .afternsgo buildornsgo testthen committed binaries, packages and.nsgo/automation.yaml.gotemplate now writes the same.gitignorethetsxandmixedtemplates do, ignoring.nsgo/anddist/. Its entries come from one list,ignoredDirs, incmd/nsgo/init.go..gitignorealready in the target directory, such as a repository's own, is kept instead of makinginitrefuse the directory. When it has no line for.nsgo/ordist/(written asdirwith an optional leading/or**/and an optional trailing/,/*or/**),initwarns which entries it lacks and leaves the file untouched. The check is advisory: a.gitignoreinitcannot read, such as a directory or a file without read permission, only warns, soinitnever fails after it has written the app.TestInitWritesGitignorechecks every template writes the file with both entries, and that an existing.gitignoreis kept, with a warning only when it lacks an entry, no warning for globbed forms such as**/.nsgo/or/dist/*, and a warning rather than an error when it cannot be read.docs/architecture/tool.mdand thensgoskill list.gitignorefor every template; achangelog.dfragment records the fix.Module templates (
-template <module>) are unchanged: they write what the module ships.Fixes #2830
Targets
core,base,ui,tsx, thensgotool)Screenshots
None
Verification
c8453ed178bad72593dbd7045fc73ffef11a0c5a8e5c1cc14ee7cd3cc4673eed0655f9ff482b7908go tool nsgo test -run 'TestInit|TestSkill|TestDirAppName' ./cmd/nsgo ./skills/...(darwin/amd64, atc8453ed17) → 0go vet ./cmd/nsgo(darwin/amd64, atc8453ed17) → 0go tool nsgo test ./cmd/nsgo ./internal/moduletest ./tools/changelog(darwin/amd64, Command Line Tools only, over SSH, at7337c89bf, before the review fixes) → 1: 346 passed, 5 failed, none in code this change touches:TestTVBrandAssetsandTestCompileBrandAssetsneed Xcode'sactool,TestRuntimeStalefailed on the host's git setup (nothing to commit),TestPublicAPINamesNoInternalTypegot no export data fortsx/ui/chat, and the package hit its 10-minute timeout insideTestInitModuleTemplate, which fetches a module template through the network and takes theinitModuleTemplatepath this change leaves alonefailgo tool nsgo checkacross targets did not finish locally (the build host's sync stalled when the local disk filled up), so cross-target vet is left to CI; the full./cmd/nsgopackage run was not repeated after the review fixes, which touch onlyinit.go, its test and docs; Linux and Windows runtime tests;TestInitModuleTemplateand the Xcode-dependent icon tests