Prerequisites
Before you begin, ensure you have the following installed:- Rust (latest stable version)
- Git
- A GitHub account (for forking and pull requests)
Initial Setup
1. Fork and Clone
First, fork the envcheck repository on GitHub, then clone your fork:2. Build the Project
Build envcheck to ensure everything is set up correctly:3. Run Tests
Verify that all tests pass:Development Workflow
Running envcheck Locally
You can run your local version of envcheck:Code Formatting
Before committing, always format your code:Linting
Run Clippy to catch common mistakes and improve code quality:Running Specific Tests
When working on a specific feature, you can run targeted tests:Project Structure
Understanding the project structure will help you navigate the codebase:Key Components
main.rs: Entry point for the CLI applicationconfig.rs: Handles parsing of.envcheck.yamlconfiguration filesvalidators/: Contains all validation logic, with each validator type in its own filereporter.rs: Formats and displays validation resultstests/: Integration tests that test the full application
Making Changes
1. Create a Branch
Create a new branch for your changes:2. Make Your Changes
Edit the relevant files. Follow the coding style guidelines and add tests for new functionality.3. Test Your Changes
Ensure all tests pass and your code is properly formatted:4. Commit Your Changes
Commit with a clear, descriptive message:5. Push and Create PR
Push your branch and create a pull request:Debugging Tips
Enable Debug Logging
You can add debug logging to your code:dbg! macro:
Run with Backtrace
For better error messages:Common Issues
Build Failures
If you encounter build failures:- Ensure you’re using the latest stable Rust:
rustup update - Clean the build directory:
cargo clean - Rebuild:
cargo build
Test Failures
If tests fail:- Ensure you’re on the latest
mainbranch - Check if you have all required dependencies installed
- Run tests with output to see detailed errors:
cargo test -- --nocapture
Next Steps
Now that your environment is set up:- Check out the Adding Validators guide to learn how to add new validator types
- Look for
good first issuelabels on GitHub - Join the discussion in existing issues and pull requests
