Thank you for your interest in contributing to nrs! This document provides guidelines and instructions for contributing.
- Rust 1.70 or later
- Git
# Clone the repository
git clone https://github.com/user/nrs
cd nrs
# Build the project
cargo build
# Run tests
cargo test
# Run the project
cargo run
# Run with arguments
cargo run -- --list
cargo run -- --debugnrs/
├── src/
│ ├── main.rs # Entry point
│ ├── lib.rs # Library root
│ ├── cli.rs # CLI argument parsing
│ ├── error.rs # Error types
│ ├── config/ # Configuration system
│ ├── package/ # Package.json parsing
│ ├── history/ # History tracking
│ ├── tui/ # Terminal UI
│ ├── runner/ # Script execution
│ ├── filter/ # Fuzzy filtering
│ └── utils/ # Utilities
├── tests/
│ ├── integration/ # Integration tests
│ └── package_parsing.rs
├── docs/ # Documentation
└── benches/ # Benchmarks
# Run all tests
cargo test
# Run tests with output
cargo test -- --nocapture
# Run a specific test
cargo test test_name
# Run integration tests only
cargo test --test integration_tests
# Update snapshot tests
cargo insta test --acceptWe use rustfmt for code formatting:
# Format all code
cargo fmt
# Check formatting without making changes
cargo fmt --checkWe use clippy for linting:
# Run clippy
cargo clippy
# Run clippy with warnings as errors
cargo clippy -- -D warnings- Follow the Rust API Guidelines
- Write doc comments for all public items
- Keep functions small and focused
- Use meaningful variable names
- Add tests for new functionality
- Handle errors gracefully with helpful messages
We follow Conventional Commits:
type(scope): description
[optional body]
[optional footer]
Types:
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style changes (formatting, etc.)refactor: Code refactoringtest: Test changeschore: Build/tooling changes
Examples:
feat(tui): add multi-select mode
fix(parser): handle empty scripts object
docs(readme): add installation instructions
-
Fork the repository and create a new branch:
git checkout -b feat/my-feature
-
Make your changes and ensure:
- All tests pass:
cargo test - Code is formatted:
cargo fmt - No clippy warnings:
cargo clippy -- -D warnings - Documentation builds:
cargo doc --no-deps
- All tests pass:
-
Write tests for new functionality
-
Update documentation if needed:
- README.md for user-facing changes
- Doc comments for API changes
- CHANGELOG.md for notable changes
-
Submit a pull request with:
- Clear title describing the change
- Description of what and why
- Any breaking changes noted
When reporting issues, please include:
- nrs version (
nrs --version) - Operating system and version
- Rust version (
rustc --version) - Steps to reproduce
- Expected behavior
- Actual behavior
- Any error messages
We welcome feature requests! Please:
- Check existing issues to avoid duplicates
- Describe the use case
- Explain why this feature would be useful
- Consider if it fits the project scope
- Be respectful and inclusive
- Welcome newcomers
- Provide constructive feedback
- Focus on the code, not the person
- Open an issue for bugs or questions
- Check existing documentation and issues first
- Be patient - maintainers are volunteers
By contributing, you agree that your contributions will be licensed under the MIT License.