feat(gitignore): Auto-manage cache directory in .gitignore#10
Merged
Conversation
commit: |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds automatic management of the cache directory in .gitignore during initialization and when adding sources to a new configuration. The implementation includes a new gitignore module for detecting and writing entries, prompts in the init and add commands, and enhanced CLI output.
Changes:
- New gitignore module with entry normalization, detection, and writing functionality
- Init command prompts users to add cache directory to .gitignore (skipped if entry already exists)
- Add command automatically updates .gitignore when creating a new config file
- CLI output reports when .gitignore is updated
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/gitignore.ts | New module implementing gitignore entry detection and writing with normalization logic |
| src/init.ts | Integrated gitignore status checking and prompting, added return fields for gitignore updates |
| src/add.ts | Added automatic gitignore updates when initializing new config, tracks whether config previously existed |
| src/cli/index.ts | Added output messages to report gitignore updates for both init and add commands |
| tests/init.test.js | Updated test stubs and added tests for gitignore writing and prompt skipping |
| tests/cli-add.test.js | Added test to verify gitignore is written when add command creates new config |
| .gitignore | Removed duplicate .docs entries and replaced with single .docs/ entry |
| AGENTS.md | Added testing expectations section |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
Automatically add cache directory to .gitignore during init and add operations.
Changes