Thank you for your interest in contributing to ProRT-IP WarScan! This document provides guidelines and instructions for contributing to the project.
- Code of Conduct
- Getting Started
- How to Contribute
- Development Setup
- Coding Standards
- Testing Requirements
- Security Guidelines
- Pull Request Process
- Commit Message Conventions
- Branch Naming Conventions
- Issue Guidelines
- Code Review Process
- Release Process
This project is dedicated to providing a welcoming and inclusive environment for all contributors. Please be respectful and professional in all interactions.
-
Fork the repository on GitHub
-
Clone your fork locally:
git clone https://github.com/YOUR_USERNAME/ProRT-IP.git cd ProRT-IP -
Add upstream remote:
git remote add upstream https://github.com/doublegate/ProRT-IP.git
-
Set up your development environment (see Development Setup)
There are several ways to contribute to ProRT-IP WarScan:
- Search existing issues first to avoid duplicates
- Use the bug report template when creating new issues
- Include detailed information:
- Operating system and version
- Rust version (
rustc --version) - Steps to reproduce
- Expected vs actual behavior
- Error messages and stack traces
- Sample command that triggers the bug
- Check the roadmap first: docs/01-ROADMAP.md
- Search existing feature requests to avoid duplicates
- Provide detailed description:
- Use case and problem it solves
- Proposed solution
- Alternative approaches considered
- Impact on existing functionality
- Start with good first issues labeled
good-first-issue - Discuss major changes in an issue before starting work
- Follow the development workflow outlined below
- Write tests for all new functionality
- Update documentation as needed
- Fix typos, clarify explanations, add examples
- Update outdated information
- Add missing documentation for features
- Improve README and guides
Complete development setup instructions are available in docs/03-DEV-SETUP.md.
-
Install Rust (1.85+ required, MSRV for edition 2024):
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
-
Install system dependencies:
- Linux:
libpcap-dev,pkg-config - Windows: Npcap 1.70+
- macOS: ChmodBPF or run with sudo
- Linux:
-
Build the project:
cargo build
-
Run tests:
cargo test -
Set up pre-commit hooks (recommended):
ProRT-IP uses pre-commit hooks to validate code quality before commits.
Option 1: Installation Script (Recommended)
./scripts/install-hooks.sh
Option 2: Manual Installation
cp .github/hooks/pre-commit .git/hooks/pre-commit chmod +x .git/hooks/pre-commit
Option 3: Use core.hooksPath (Advanced)
git config core.hooksPath .github/hooks
The pre-commit hook automatically validates:
- ✅ Cargo.lock synchronized with Cargo.toml changes
- ✅ Code formatting (
cargo fmt --check) - ✅ Clippy linting (
cargo clippy --workspace -- -D warnings)
Bypassing (not recommended):
git commit --no-verify # Only use in emergencies
ProRT-IP has two pre-commit hook files:
-
.github/hooks/pre-commit(version controlled)- Source of truth, shared with all developers
- Updated via pull requests
- Tracked in Git repository
-
.git/hooks/pre-commit(local, not in Git)- Active hook that Git executes
- Copied from template in
.github/hooks/ - Not version controlled (lives in
.git/directory)
Why two files? Git only executes hooks from the .git/hooks/ directory, which is never version controlled. To share hooks with the team, we store the template in .github/hooks/ (version controlled) and developers copy it to .git/hooks/ (local installation).
This is a standard Git workflow pattern used by projects like Homebrew, Kubernetes, and Linux Kernel.
If the hook template in .github/hooks/pre-commit is updated (via pull request):
# Re-install to get latest version
./scripts/install-hooks.sh
# Or manually
cp .github/hooks/pre-commit .git/hooks/pre-commitTip: Run git pull before re-installing to ensure you have the latest template.
-
Use
rustfmtfor consistent formatting:cargo fmt --check # Check formatting cargo fmt # Apply formatting
-
Use
clippyfor linting:cargo clippy -- -D warnings
-
No warnings allowed in submitted code - all
clippywarnings must be resolved
-
Clear, descriptive names for functions, variables, types
-
Comprehensive documentation for all public APIs:
/// Performs a TCP SYN scan on the specified targets. /// /// # Arguments /// /// * `targets` - IP addresses or CIDR ranges to scan /// * `ports` - Port numbers to scan /// /// # Returns /// /// A `ScanResult` containing open ports and service information /// /// # Example /// /// ``` /// let result = syn_scan(&["192.168.1.0/24"], &[80, 443])?; /// ``` pub fn syn_scan(targets: &[IpAddr], ports: &[u16]) -> Result<ScanResult>
-
Error handling using
Result<T, E>- neverunwrap()in production code -
Input validation at API boundaries
-
Resource cleanup with RAII patterns and
Dropimplementations
- Profile before optimizing - use
cargo benchandflamegraph - Document performance-critical sections with inline comments
- Use appropriate data structures (see docs/07-PERFORMANCE.md)
- Avoid premature optimization - correctness first, speed second
All contributions must follow security guidelines in docs/08-SECURITY.md:
- Input validation for all user-provided data
- Privilege dropping immediately after resource creation
- Safe packet parsing - never
panic!on malformed packets - Resource limits to prevent DoS
- No shell command construction from user input
Comprehensive testing guidelines are in docs/06-TESTING.md.
All code contributions must include:
-
Unit tests for individual functions:
#[cfg(test)] mod tests { use super::*; #[test] fn test_parse_port_range() { assert_eq!(parse_port_range("80-443").unwrap(), vec![80..=443]); } }
-
Integration tests for component interactions:
// tests/scanner_integration.rs #[tokio::test] async fn test_tcp_connect_scan() { let scanner = Scanner::new(config)?; let result = scanner.execute().await?; assert!(!result.open_ports.is_empty()); }
-
Documentation tests for public APIs (examples in doc comments)
-
>90% coverage for core modules (
prtip-core,prtip-network) -
>60% coverage for overall codebase (currently 54.92%)
-
Current Status: 2,111 tests passing, 54.92% line coverage
-
Run coverage with:
cargo tarpaulin --out Html --output-dir coverage/ # Or use project script: ./scripts/setup-dev-env.sh # Installs cargo-tarpaulin + other tools
# All tests
cargo test
# Specific test
cargo test test_syn_scan
# With output
cargo test -- --nocapture
# Integration tests only
cargo test --test '*'
# Benchmarks
cargo bench- Never publish security vulnerabilities in public issues
- Report security issues privately to the maintainers (see SECURITY.md)
- Wait for coordinated disclosure before discussing publicly
ProRT-IP WarScan is a defensive security tool for authorized penetration testing:
- No offensive capabilities - reject PRs that add malicious functionality
- Emphasize authorized use in documentation
- Include legal disclaimers where appropriate
- Audit logging for all scanning activities
All pull requests must pass automated CI checks before merging:
- Format check:
cargo fmt --check- Code must be properly formatted - Linting:
cargo clippy -- -D warnings- All clippy warnings must be resolved - Tests on all platforms: Linux, Windows, macOS - All tests must pass on each platform
- Security audit:
cargo audit- No known vulnerabilities allowed - MSRV check: Rust 1.70+ - Code must compile with minimum supported version
CI runs automatically on every push and PR. Check the Actions tab for status.
Workflow jobs:
format: ~30 seconds - Checks code formattingclippy: ~2-3 minutes - Lint checks with cachingtest: ~3-5 minutes per platform (parallel) - Build and test (789 tests)security_audit: ~1-2 minutes - Vulnerability scanningmsrv: ~2-3 minutes - Minimum version verification (Rust 1.85+)
Total CI time: ~5-10 minutes (with caching and parallel execution) Current Status: 7/7 jobs passing (100%)
Run these commands locally before pushing to save CI time:
# Check formatting
cargo fmt --all -- --check
# Run clippy (strict mode)
cargo clippy --workspace --all-targets -- -D warnings
# Run all tests
cargo test --workspace
# Security audit (optional but recommended)
cargo install cargo-audit
cargo auditThe CI pipeline uses aggressive caching for faster runs:
- Cargo registry cache: Downloaded crate metadata (~100-500 MB)
- Cargo index cache: Git index for crates.io (~50-200 MB)
- Build cache: Compiled dependencies (~500 MB - 2 GB)
Cache benefits:
- Clean build: 5-10 minutes → Cached build: 1-2 minutes (80-90% speedup)
- Cache hit rate: ~80-90% for typical changes
-
Update from upstream:
git fetch upstream git rebase upstream/main
-
Run full test suite:
cargo test cargo clippy -- -D warnings cargo fmt --check -
Update documentation if needed:
- Update
docs/if functionality changes - Update
CHANGELOG.mdwith your changes - Add/update examples in doc comments
- Update
-
Ensure clean commit history - squash WIP commits if needed
- Code follows style guidelines (
cargo fmt,cargo clippy) - All tests pass (
cargo test) - New tests added for new functionality
- Documentation updated (code comments, docs/, README)
- CHANGELOG.md updated with changes
- Security guidelines followed (docs/08-SECURITY.md)
- Commit messages follow conventions (see below)
- No new warnings introduced
- Performance impact considered and documented
- Cross-platform compatibility verified (if applicable)
## Summary
Brief description of the changes
## Motivation
Why are these changes needed? What problem do they solve?
## Changes
- Bullet list of specific changes
- Include breaking changes if any
## Testing
How were these changes tested?
## Documentation
What documentation was updated?
## Checklist
- [ ] Tests pass
- [ ] Docs updated
- [ ] CHANGELOG.md updatedWe follow Conventional Commits format:
<type>(<scope>): <subject>
<body>
<footer>
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style changes (formatting, no logic change)refactor: Code refactoring (no feature change or bug fix)perf: Performance improvementtest: Adding or updating testschore: Maintenance tasks (dependencies, build config)ci: CI/CD changes
Optional, indicates area of change:
network: Network/packet handlingscanner: Scanning enginedetection: Service/OS detectioncli: Command-line interfacecore: Core librarydocs: Documentation
feat(scanner): Add UDP scanning with protocol-specific probes
Implement UDP scanning functionality with specialized probes for
common services (DNS, SNMP, NetBIOS). Includes ICMP port unreachable
detection for closed port identification.
Fixes #42fix(network): Correct TCP checksum calculation for IPv6
The checksum pseudo-header was using IPv4 format for IPv6 packets,
causing scan failures on IPv6-only networks.
Fixes #123docs(readme): Update installation instructions for Windows
Add detailed Npcap installation steps and troubleshooting for
Windows users encountering packet capture issues.Use descriptive branch names with type prefixes:
feature/<description>- New featuresfix/<description>- Bug fixesdocs/<description>- Documentation updatesrefactor/<description>- Code refactoringtest/<description>- Test additions/updates
Examples:
feature/udp-scanningfix/tcp-checksum-ipv6docs/windows-setup-guiderefactor/packet-parser
Include:
- Environment: OS, Rust version, dependencies
- Steps to reproduce: Minimal reproducible example
- Expected behavior: What should happen
- Actual behavior: What actually happens
- Error messages: Full stack traces
- Logs: Relevant log output with
RUST_LOG=debug
Include:
- Problem statement: What problem does this solve?
- Proposed solution: How would you implement it?
- Alternatives: Other approaches considered
- Use cases: Real-world scenarios
- Breaking changes: Impact on existing functionality
Look for issues tagged good-first-issue:
- Well-defined scope
- Clear acceptance criteria
- Mentorship available
- Good learning opportunities
- Initial review: Within 3-5 business days
- Follow-up reviews: Within 2 business days
- Approval required: At least one maintainer approval
Reviewers will check:
- Functionality: Does it work as intended?
- Tests: Adequate test coverage?
- Documentation: Clear and complete?
- Code Quality: Readable, maintainable, follows conventions?
- Security: No vulnerabilities introduced?
- Performance: No significant regressions?
- Compatibility: Works across platforms?
- Be responsive to review comments
- Ask questions if feedback is unclear
- Push new commits for changes (don't force-push during review)
- Mark conversations as resolved when addressed
- Request re-review when ready
-
Create feature branch:
git checkout -b feature/my-feature
-
Make changes and commit:
git add . git commit -m "feat(scope): Add feature description"
-
Keep branch updated:
git fetch upstream git rebase upstream/main
-
Push to your fork:
git push origin feature/my-feature
-
Create pull request on GitHub
-
Address review feedback and push updates
-
Squash commits if requested before merge
This section provides a comprehensive checklist for maintainers creating new releases. Following this process prevents common issues like Cargo.lock desynchronization that can cause CI failures.
-
Version Bump
- Update version in root
Cargo.toml - Update version in all workspace member
Cargo.tomlfiles:prtip-cli/Cargo.tomlprtip-core/Cargo.tomlprtip-network/Cargo.tomlprtip-scanner/Cargo.tomlprtip-tui/Cargo.toml
- Run
cargo updateto regenerateCargo.lock - Verify with
cargo build --locked(must pass) - Stage all changes:
git add Cargo.toml */Cargo.toml Cargo.lock
- Update version in root
-
Documentation Updates
- Update
README.md(version badge, test count, new features) - Update
CHANGELOG.md(add new version section) - Update
CLAUDE.md(status line with new version) - Update
CLAUDE.local.md(header with new version) - Update
docs/00-ARCHITECTURE.md(version, test count) - Update
docs/01-ROADMAP.md(version, progress percentage) - Update
docs/10-PROJECT-STATUS.md(current version) - Update relevant technical docs (if architecture changed)
- Update
-
Quality Gates
- Run
cargo fmt --check(0 formatting issues) - Run
cargo clippy --workspace -- -D warnings(0 warnings) - Run
cargo test --workspace(all tests passing) - Run
cargo build --release(clean build) - Run
cargo audit(no security vulnerabilities) - Check coverage:
cargo tarpaulin --workspace(>54% baseline)
- Run
-
Release Notes
- Create
/tmp/ProRT-IP/RELEASE-NOTES-vX.Y.Z.md - Include: Executive summary, features, fixes, performance, quality metrics
- Length: 100-200 lines (follow v0.3.7-v0.5.5 standard)
- Technical depth: Code examples, metrics, strategic value
- Create
-
Git Workflow
- Stage all changes:
git add . - Create commit with 200+ line message (conventional format)
- Create annotated tag:
git tag -a vX.Y.Z -F /tmp/ProRT-IP/RELEASE-NOTES-vX.Y.Z.md - Verify tag:
git show vX.Y.Z - Push commit:
git push origin main - Push tag:
git push origin vX.Y.Z
- Stage all changes:
-
GitHub Release
- Create/update release:
gh release create vX.Y.Z --notes-file /tmp/ProRT-IP/RELEASE-NOTES-vX.Y.Z.md - Verify release URL and content
- Check all CI workflows pass (100% success rate)
- Create/update release:
- All GitHub Actions workflows passing (green checks)
- GitHub Release published and visible
- Release notes comprehensive and accurate
- No broken links in documentation
- CI/CD coverage workflow uploading to Codecov
- All platforms validated (Linux, macOS, Windows)
cargo build --locked verification
ProRT-IP uses cargo-release to automate version bumps and releases, reducing manual errors and ensuring consistency.
cargo install cargo-releaseRelease automation is configured in release.toml at the repository root. This configuration handles:
- Workspace-wide version bumps
- Cargo.lock regeneration
- Documentation version updates
- Pre-release quality checks
# Patch release (0.5.5 → 0.5.6)
./scripts/release.sh patch
# Minor release (0.5.6 → 0.6.0)
./scripts/release.sh minor
# Major release (0.6.0 → 1.0.0)
./scripts/release.sh majorThe release.sh script automates:
- Pre-flight checks (fmt, clippy, test, lockfile validation)
- Version bumps in all Cargo.toml files
- Cargo.lock regeneration
- Documentation version updates (README, CLAUDE.md, docs/)
- Git commit and tag creation
- Create release notes: Write
/tmp/ProRT-IP/RELEASE-NOTES-vX.Y.Z.md - Push to GitHub:
git push origin main && git push origin --tags - Create GitHub Release:
gh release create vX.Y.Z --notes-file /tmp/ProRT-IP/RELEASE-NOTES-vX.Y.Z.md
Before executing a release, test with dry-run mode:
cargo release patch --dry-runThis shows all changes that would be made without actually executing them.
# Version bump workflow (manual)
cargo update
cargo build --locked
# Quality checks (run before release)
cargo fmt --check && cargo clippy --workspace -- -D warnings && cargo test --workspace
# Release workflow (manual)
git add . && git commit -m "release(vX.Y.Z): ..."
git tag -a vX.Y.Z -F /tmp/ProRT-IP/RELEASE-NOTES-vX.Y.Z.md
git push origin main && git push origin vX.Y.Z
gh release create vX.Y.Z --notes-file /tmp/ProRT-IP/RELEASE-NOTES-vX.Y.Z.md- Architecture: docs/00-ARCHITECTURE.md
- Development Roadmap: docs/01-ROADMAP.md
- Technical Specifications: docs/02-TECHNICAL-SPECS.md
- Development Setup: docs/03-DEV-SETUP.md
- Implementation Guide: docs/04-IMPLEMENTATION-GUIDE.md
- API Reference: docs/05-API-REFERENCE.md
- Testing Strategy: docs/06-TESTING.md
- Performance Optimization: docs/07-PERFORMANCE.md
- Security Implementation: docs/08-SECURITY.md
- FAQ: docs/09-FAQ.md
- Project Status: docs/10-PROJECT-STATUS.md
- Documentation: See docs/README.md for navigation
- FAQ: Check docs/09-FAQ.md for common questions
- Support: See SUPPORT.md for help resources
- Security: See SECURITY.md for vulnerability reporting
By contributing to ProRT-IP WarScan, you agree that your contributions will be licensed under the GNU General Public License v3.0 (GPLv3).
Thank you for contributing to ProRT-IP WarScan!