From 4ddf6e289345e24f6a8552898c69404c6c290eb8 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sat, 12 Jul 2025 11:50:30 +0000 Subject: [PATCH 1/7] doc(contributing): add comprehensive mise development guidelines Co-authored-by: jeff --- .cursorrules | 211 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 211 insertions(+) create mode 100644 .cursorrules diff --git a/.cursorrules b/.cursorrules new file mode 100644 index 0000000000..33a37560c6 --- /dev/null +++ b/.cursorrules @@ -0,0 +1,211 @@ +# Cursor Rules for mise + +## Project Context +mise is a development environment setup tool written in Rust that manages: +- Dev Tools: Version management for programming languages and tools +- Environments: Environment variable management +- Tasks: Task runner for project automation + +## Conventional Commits (REQUIRED) +All commit messages and PR titles MUST follow conventional commit format: + +### Commit Types +- `feat:` - New features +- `fix:` - Bug fixes +- `refactor:` - Code refactoring +- `doc:` - Documentation changes +- `style:` - Code style/formatting +- `perf:` - Performance improvements +- `test:` - Testing changes +- `chore:` - Maintenance tasks +- `chore(deps):` - Dependency updates +- `chore(security):` - Security updates + +### Commit Format +``` +(): + +[optional body] + +[optional footer] +``` + +### Examples +``` +feat(cli): add new command for tool management +fix(config): resolve parsing issue with nested tables +refactor(backend): simplify plugin loading logic +doc(api): update configuration examples +test(e2e): add tests for tool installation +chore(deps): update Rust dependencies +``` + +### Scopes (Common) +- `cli` - Command line interface +- `config` - Configuration handling +- `backend` - Backend/plugin systems +- `tool` - Tool management +- `env` - Environment handling +- `task` - Task runner +- `api` - API changes +- `ui` - User interface +- `core` - Core functionality + +## Development Guidelines + +### Code Quality +- Follow existing Rust patterns and conventions +- Use `cargo fmt` for formatting (enforced by CI) +- Use `cargo clippy` for linting +- Maintain comprehensive test coverage +- Use `hk` for pre-commit hooks and linting + +### Testing Requirements +- Write unit tests for new functionality (`cargo test`) +- Add E2E tests for user-facing features (`mise run test:e2e`) +- Update test snapshots when output changes (`mise run snapshots`) +- Ensure tests pass on Linux, macOS, and Windows + +### Documentation +- Update documentation for new features +- Add inline code documentation +- Update CLI help text and completions +- Consider adding examples to docs/ + +### File Structure +``` +mise/ +├── src/ # Main Rust source code +├── e2e/ # End-to-end tests +├── docs/ # Documentation +├── tasks.toml # Development tasks +├── mise.toml # Project configuration +└── xtasks/ # Additional build scripts +``` + +## Code Patterns + +### Error Handling +- Use `Result` for fallible operations +- Prefer `?` operator for error propagation +- Use `miette` for user-friendly error messages +- Add context to errors with `.with_context()` + +### Configuration +- Use `serde` for serialization/deserialization +- Support multiple config formats (TOML, JSON, YAML) +- Validate configuration early +- Provide helpful error messages for invalid config + +### Plugin System +- Maintain compatibility with asdf plugins +- Use consistent plugin API patterns +- Handle plugin errors gracefully +- Support plugin shortcuts from registry + +### CLI Design +- Use `clap` for command-line parsing +- Provide helpful error messages +- Support both short and long flags +- Include usage examples in help text + +## Development Workflow + +### Before Starting +1. File an issue or discuss in Discord for non-obvious changes +2. Look for "help wanted" and "good first issue" labels +3. Ensure you understand the existing patterns + +### Development Process +1. Create feature branch from main +2. Write tests first (TDD approach preferred) +3. Implement feature following existing patterns +4. Run `mise run build` to verify compilation +5. Run `mise run test` to verify all tests pass +6. Run `mise run lint` to check code quality +7. Update documentation if needed +8. Commit with conventional commit format + +### Pull Request Requirements +- PR title must follow conventional commit format +- All CI checks must pass (Linux, macOS, Windows) +- Tests must maintain or improve coverage +- Documentation must be updated for new features +- Code will be auto-formatted by autofix.ci + +## Common Commands + +### Testing +- `cargo test` - Run unit tests +- `mise run test:e2e` - Run E2E tests +- `mise run test` - Run all tests +- `./e2e/run_test test_name` - Run specific E2E test + +### Development +- `mise run build` - Build the project +- `mise run lint` - Run linting +- `mise run lint:fix` - Run linting with fixes +- `mise run format` - Format code +- `mise run snapshots` - Update test snapshots +- `mise run render` - Generate docs and completions + +### Quality Checks +- `hk check --all` - Run all linters +- `hk fix --all` - Run linters with fixes +- `cargo clippy` - Run Rust linting +- `cargo fmt` - Format Rust code + +## Environment Setup + +### For Development +```bash +# Disable mise during development testing +export MISE_DISABLE_TOOLS=1 + +# Set GitHub token to avoid rate limits +export MISE_GITHUB_TOKEN=your_token_here + +# Use development shim +# Create ~/.local/bin/@mise with: +#!/bin/sh +exec cargo run -q --all-features --manifest-path ~/src/mise/Cargo.toml -- "$@" +``` + +### For Testing +```bash +# Run tests with trusted config +MISE_TRUSTED_CONFIG_PATHS=$PWD cargo test + +# Run all tests including slow ones +TEST_ALL=1 mise run test:e2e +``` + +## Breaking Changes +- Always document breaking changes in commit messages +- Use `BREAKING CHANGE:` footer in commit message +- Consider backwards compatibility when possible +- Update migration documentation + +## Security +- Use `cargo audit` to check for vulnerabilities +- Validate all user inputs +- Use secure defaults +- Follow Rust security best practices + +## Performance +- Profile critical paths +- Use `criterion` for benchmarks +- Minimize allocations in hot paths +- Consider async/parallel execution for I/O + +## Dependencies +- New dependencies are validated with cargo-deny +- Prefer established, well-maintained crates +- Consider licensing compatibility +- Minimize dependency footprint when possible + +## When in Doubt +- Check existing code patterns +- Ask in Discord: https://discord.gg/UBa7pJUN7Z +- Reference the comprehensive contributing guide +- Look at recent PRs for examples \ No newline at end of file From e8a0c2d1014957de010ca3e9291cb1bb56f8742a Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sat, 12 Jul 2025 11:54:36 +0000 Subject: [PATCH 2/7] chore(docs): Move cursor rules to .cursor/rules directory Co-authored-by: jeff --- .cursor/rules | 46 +++++++++++ .cursorrules | 211 -------------------------------------------------- 2 files changed, 46 insertions(+), 211 deletions(-) create mode 100644 .cursor/rules delete mode 100644 .cursorrules diff --git a/.cursor/rules b/.cursor/rules new file mode 100644 index 0000000000..379269a71f --- /dev/null +++ b/.cursor/rules @@ -0,0 +1,46 @@ +# Cursor Rules for mise + +## Conventional Commits (REQUIRED) +All commit messages and PR titles MUST follow conventional commit format: + +### Commit Types +- `feat:` - New features +- `fix:` - Bug fixes +- `refactor:` - Code refactoring +- `doc:` - Documentation changes +- `style:` - Code style/formatting +- `perf:` - Performance improvements +- `test:` - Testing changes +- `chore:` - Maintenance tasks +- `chore(deps):` - Dependency updates +- `chore(security):` - Security updates + +### Commit Format +``` +(): + +[optional body] + +[optional footer] +``` + +### Examples +``` +feat(cli): add new command for tool management +fix(config): resolve parsing issue with nested tables +refactor(backend): simplify plugin loading logic +doc(api): update configuration examples +test(e2e): add tests for tool installation +chore(deps): update Rust dependencies +``` + +### Common Scopes +- `cli` - Command line interface +- `config` - Configuration handling +- `backend` - Backend/plugin systems +- `tool` - Tool management +- `env` - Environment handling +- `task` - Task runner +- `api` - API changes +- `ui` - User interface +- `core` - Core functionality \ No newline at end of file diff --git a/.cursorrules b/.cursorrules deleted file mode 100644 index 33a37560c6..0000000000 --- a/.cursorrules +++ /dev/null @@ -1,211 +0,0 @@ -# Cursor Rules for mise - -## Project Context -mise is a development environment setup tool written in Rust that manages: -- Dev Tools: Version management for programming languages and tools -- Environments: Environment variable management -- Tasks: Task runner for project automation - -## Conventional Commits (REQUIRED) -All commit messages and PR titles MUST follow conventional commit format: - -### Commit Types -- `feat:` - New features -- `fix:` - Bug fixes -- `refactor:` - Code refactoring -- `doc:` - Documentation changes -- `style:` - Code style/formatting -- `perf:` - Performance improvements -- `test:` - Testing changes -- `chore:` - Maintenance tasks -- `chore(deps):` - Dependency updates -- `chore(security):` - Security updates - -### Commit Format -``` -(): - -[optional body] - -[optional footer] -``` - -### Examples -``` -feat(cli): add new command for tool management -fix(config): resolve parsing issue with nested tables -refactor(backend): simplify plugin loading logic -doc(api): update configuration examples -test(e2e): add tests for tool installation -chore(deps): update Rust dependencies -``` - -### Scopes (Common) -- `cli` - Command line interface -- `config` - Configuration handling -- `backend` - Backend/plugin systems -- `tool` - Tool management -- `env` - Environment handling -- `task` - Task runner -- `api` - API changes -- `ui` - User interface -- `core` - Core functionality - -## Development Guidelines - -### Code Quality -- Follow existing Rust patterns and conventions -- Use `cargo fmt` for formatting (enforced by CI) -- Use `cargo clippy` for linting -- Maintain comprehensive test coverage -- Use `hk` for pre-commit hooks and linting - -### Testing Requirements -- Write unit tests for new functionality (`cargo test`) -- Add E2E tests for user-facing features (`mise run test:e2e`) -- Update test snapshots when output changes (`mise run snapshots`) -- Ensure tests pass on Linux, macOS, and Windows - -### Documentation -- Update documentation for new features -- Add inline code documentation -- Update CLI help text and completions -- Consider adding examples to docs/ - -### File Structure -``` -mise/ -├── src/ # Main Rust source code -├── e2e/ # End-to-end tests -├── docs/ # Documentation -├── tasks.toml # Development tasks -├── mise.toml # Project configuration -└── xtasks/ # Additional build scripts -``` - -## Code Patterns - -### Error Handling -- Use `Result` for fallible operations -- Prefer `?` operator for error propagation -- Use `miette` for user-friendly error messages -- Add context to errors with `.with_context()` - -### Configuration -- Use `serde` for serialization/deserialization -- Support multiple config formats (TOML, JSON, YAML) -- Validate configuration early -- Provide helpful error messages for invalid config - -### Plugin System -- Maintain compatibility with asdf plugins -- Use consistent plugin API patterns -- Handle plugin errors gracefully -- Support plugin shortcuts from registry - -### CLI Design -- Use `clap` for command-line parsing -- Provide helpful error messages -- Support both short and long flags -- Include usage examples in help text - -## Development Workflow - -### Before Starting -1. File an issue or discuss in Discord for non-obvious changes -2. Look for "help wanted" and "good first issue" labels -3. Ensure you understand the existing patterns - -### Development Process -1. Create feature branch from main -2. Write tests first (TDD approach preferred) -3. Implement feature following existing patterns -4. Run `mise run build` to verify compilation -5. Run `mise run test` to verify all tests pass -6. Run `mise run lint` to check code quality -7. Update documentation if needed -8. Commit with conventional commit format - -### Pull Request Requirements -- PR title must follow conventional commit format -- All CI checks must pass (Linux, macOS, Windows) -- Tests must maintain or improve coverage -- Documentation must be updated for new features -- Code will be auto-formatted by autofix.ci - -## Common Commands - -### Testing -- `cargo test` - Run unit tests -- `mise run test:e2e` - Run E2E tests -- `mise run test` - Run all tests -- `./e2e/run_test test_name` - Run specific E2E test - -### Development -- `mise run build` - Build the project -- `mise run lint` - Run linting -- `mise run lint:fix` - Run linting with fixes -- `mise run format` - Format code -- `mise run snapshots` - Update test snapshots -- `mise run render` - Generate docs and completions - -### Quality Checks -- `hk check --all` - Run all linters -- `hk fix --all` - Run linters with fixes -- `cargo clippy` - Run Rust linting -- `cargo fmt` - Format Rust code - -## Environment Setup - -### For Development -```bash -# Disable mise during development testing -export MISE_DISABLE_TOOLS=1 - -# Set GitHub token to avoid rate limits -export MISE_GITHUB_TOKEN=your_token_here - -# Use development shim -# Create ~/.local/bin/@mise with: -#!/bin/sh -exec cargo run -q --all-features --manifest-path ~/src/mise/Cargo.toml -- "$@" -``` - -### For Testing -```bash -# Run tests with trusted config -MISE_TRUSTED_CONFIG_PATHS=$PWD cargo test - -# Run all tests including slow ones -TEST_ALL=1 mise run test:e2e -``` - -## Breaking Changes -- Always document breaking changes in commit messages -- Use `BREAKING CHANGE:` footer in commit message -- Consider backwards compatibility when possible -- Update migration documentation - -## Security -- Use `cargo audit` to check for vulnerabilities -- Validate all user inputs -- Use secure defaults -- Follow Rust security best practices - -## Performance -- Profile critical paths -- Use `criterion` for benchmarks -- Minimize allocations in hot paths -- Consider async/parallel execution for I/O - -## Dependencies -- New dependencies are validated with cargo-deny -- Prefer established, well-maintained crates -- Consider licensing compatibility -- Minimize dependency footprint when possible - -## When in Doubt -- Check existing code patterns -- Ask in Discord: https://discord.gg/UBa7pJUN7Z -- Reference the comprehensive contributing guide -- Look at recent PRs for examples \ No newline at end of file From 36fe1dde3c6a8c499a07af6908c33c48ef67f240 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sat, 12 Jul 2025 11:59:42 +0000 Subject: [PATCH 3/7] Checkpoint before follow-up message --- .cursor/{rules => rules.mdc} | 32 +++++++++----------------------- 1 file changed, 9 insertions(+), 23 deletions(-) rename .cursor/{rules => rules.mdc} (62%) diff --git a/.cursor/rules b/.cursor/rules.mdc similarity index 62% rename from .cursor/rules rename to .cursor/rules.mdc index 379269a71f..d94cd19ccf 100644 --- a/.cursor/rules +++ b/.cursor/rules.mdc @@ -1,28 +1,22 @@ -# Cursor Rules for mise - ## Conventional Commits (REQUIRED) + All commit messages and PR titles MUST follow conventional commit format: -### Commit Types +### Format +``` +(): +``` + +### Types - `feat:` - New features - `fix:` - Bug fixes - `refactor:` - Code refactoring -- `doc:` - Documentation changes +- `doc:` - Documentation - `style:` - Code style/formatting - `perf:` - Performance improvements - `test:` - Testing changes - `chore:` - Maintenance tasks - `chore(deps):` - Dependency updates -- `chore(security):` - Security updates - -### Commit Format -``` -(): - -[optional body] - -[optional footer] -``` ### Examples ``` @@ -35,12 +29,4 @@ chore(deps): update Rust dependencies ``` ### Common Scopes -- `cli` - Command line interface -- `config` - Configuration handling -- `backend` - Backend/plugin systems -- `tool` - Tool management -- `env` - Environment handling -- `task` - Task runner -- `api` - API changes -- `ui` - User interface -- `core` - Core functionality \ No newline at end of file +`cli`, `config`, `backend`, `tool`, `env`, `task`, `api`, `ui`, `core` \ No newline at end of file From 0e4d859316e302041a68373bd83ca6ee8dc87481 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sat, 12 Jul 2025 12:00:06 +0000 Subject: [PATCH 4/7] Add metadata and description to conventional commits rules file Co-authored-by: jeff --- .cursor/rules.mdc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.cursor/rules.mdc b/.cursor/rules.mdc index d94cd19ccf..6a06ebb6a2 100644 --- a/.cursor/rules.mdc +++ b/.cursor/rules.mdc @@ -1,3 +1,9 @@ +--- +description: Conventional commit formatting rules for mise project +globs: +alwaysApply: true +--- + ## Conventional Commits (REQUIRED) All commit messages and PR titles MUST follow conventional commit format: From 37ef87f8cdd6b51e6f77ed94ce2c43c0fc8e67f5 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sat, 12 Jul 2025 12:00:47 +0000 Subject: [PATCH 5/7] Checkpoint before follow-up message --- .cursor/{rules.mdc => rules/conventional_commits.mdc} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .cursor/{rules.mdc => rules/conventional_commits.mdc} (100%) diff --git a/.cursor/rules.mdc b/.cursor/rules/conventional_commits.mdc similarity index 100% rename from .cursor/rules.mdc rename to .cursor/rules/conventional_commits.mdc From af797306d277ad63a45c83fee1f801cdd21f60f0 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sat, 12 Jul 2025 12:01:47 +0000 Subject: [PATCH 6/7] Changes from background composer bc-87442d43-ab3d-4909-b99f-764a33388caf --- .cursor/rules/conventional_commits.mdc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.cursor/rules/conventional_commits.mdc b/.cursor/rules/conventional_commits.mdc index 6a06ebb6a2..84dc31a0ce 100644 --- a/.cursor/rules/conventional_commits.mdc +++ b/.cursor/rules/conventional_commits.mdc @@ -4,6 +4,12 @@ globs: alwaysApply: true --- +--- +description: Conventional commit formatting rules for mise project +globs: +alwaysApply: true +--- + ## Conventional Commits (REQUIRED) All commit messages and PR titles MUST follow conventional commit format: @@ -35,4 +41,4 @@ chore(deps): update Rust dependencies ``` ### Common Scopes -`cli`, `config`, `backend`, `tool`, `env`, `task`, `api`, `ui`, `core` \ No newline at end of file +`registry`, `aqua`, `cli`, `config`, `backend`, `tool`, `env`, `task`, `api`, `ui`, `core`, `deps`, `schema`, `doctor`, `shim`, `security` \ No newline at end of file From b74264fd7ed24029d83438b3290370131773b323 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sat, 12 Jul 2025 12:02:09 +0000 Subject: [PATCH 7/7] Remove duplicate header in conventional commits rule file Co-authored-by: jeff --- .cursor/rules/conventional_commits.mdc | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/.cursor/rules/conventional_commits.mdc b/.cursor/rules/conventional_commits.mdc index 84dc31a0ce..f17453a0c7 100644 --- a/.cursor/rules/conventional_commits.mdc +++ b/.cursor/rules/conventional_commits.mdc @@ -1,15 +1,3 @@ ---- -description: Conventional commit formatting rules for mise project -globs: -alwaysApply: true ---- - ---- -description: Conventional commit formatting rules for mise project -globs: -alwaysApply: true ---- - ## Conventional Commits (REQUIRED) All commit messages and PR titles MUST follow conventional commit format: