This document provides recommended steps for the OpenAI Codex assistant when making changes to the cmdy repository.
-
After applying code changes or patches, run:
cargo check cargo fix --allow-dirty cargo fmt cargo clippy -- -D warnings
cargo checkverifies that the code compiles without errors.cargo fix --allow-dirtyapplies automatic fixes (e.g., unused imports) and allows minor edits to your working directory.cargo fmtensures consistent code formatting.cargo clippy -- -D warningschecks for common mistakes and ensures no clippy warnings.
-
Verify functionality and ensure all tests pass:
cargo test # Unit tests cargo test --test integration # Integration tests
-
Before pushing changes, run the pre-push checks:
./scripts/pushable
When processing dependabot pull requests:
-
Check all open dependabot PRs:
gh pr list --author "app/dependabot" --state open -
For each PR, checkout and run validation:
gh pr checkout <PR_NUMBER> ./scripts/pushable
-
Common issues and fixes:
- Clippy warnings: Fix any
map().unwrap_or_else()warnings by replacing withmap_or_else() - Integration test failures: Ensure the program handles edge cases gracefully (e.g., missing directories should exit with code 0)
- Merge conflicts: After merging one PR, rebase others on main to resolve conflicts
- Clippy warnings: Fix any
-
If fixes are needed:
# Make necessary fixes cargo fmt git add -A git commit -m "fix: <description of fix>" git push
The project uses cargo-release for version management. Follow these steps:
-
Ensure all tests pass and CI is green:
cargo test ./scripts/pushable -
Determine version bump type:
- patch (0.1.5 → 0.1.6): Bug fixes, dependency updates
- minor (0.1.5 → 0.2.0): New features, backward-compatible changes
- major (0.1.5 → 1.0.0): Breaking changes
-
Create the release:
# For patch release (most common) cargo release patch --no-publish --execute # For minor release cargo release minor --no-publish --execute # For major release cargo release major --no-publish --execute
-
The release process will:
- Update version in Cargo.toml and Cargo.lock
- Create a release commit: "chore: release X.Y.Z"
- Create a git tag: "vX.Y.Z"
- Push commit and tag to GitHub
- Trigger GitHub Actions to publish to crates.io
-
If a release fails CI, rollback and retry:
# Delete the tag locally and remotely git tag -d v0.1.X git push origin :v0.1.X # Fix the issue, then re-release cargo release patch --no-publish --execute
- Keep changes minimal and focused on the user's request.
- Maintain coding style consistent with the existing codebase.
- Use
git statusto review uncommitted changes before concluding a task. - Do not add unrelated modifications or fix pre-existing issues outside of the described task scope.
- Only add code comments when they explain something unusual or complex. Do not narrate all the code.
- Always run
cargo fmtbefore committing to ensure consistent formatting. - Ensure CI passes before merging any changes.