-
Notifications
You must be signed in to change notification settings - Fork 0
feat: new spec command #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
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
- Remove commit/push from new command (user handles this) - Remove CommitChanges and PushBranch functions - Remove related tests - Remove unused git import from cmd/new.go
- Prevents branch name conflicts by including YYYY-MM-DD suffix - Updates context to generate branch names as spec/NNN-title-YYYY-MM-DD - Updates test to verify date suffix is present
- More accurately reflects the function's behavior (converts to slug and sanitizes) - Update all references in context.go and spec_test.go - Update comments to clarify purpose
- Rename internal/new Context to NewCommandContext - Rename internal/setup Context to SetupCommandContext - Each command now has a clearly named context type
- Matches naming pattern in internal/new/context.go - Both packages now have context.go as their main file
- Matches the naming of the test file in internal/new - Both test files now follow the context_test.go naming pattern
- Add OriginalBranch field to NewCommandContext - Add GetCurrentBranch() helper to git package - Cleanup now checks out to original branch before deleting spec branch - Update integration tests to create initial commit
- Verifies spec file is removed - Verifies branch is deleted - Verifies original branch is restored
- Add test for missing file scenario - Add test for restoring different branch (not main/master) - All edge cases pass
- Add test coverage requirements - Document table-driven test pattern - Include edge case testing guidance - Add helper function and mocking best practices - Include test naming conventions
- Add defensive cleanup call if CreateSpec fails - Ensures no dangling files or branches even if CreateSpec error handling is bypassed
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.
No description provided.