First off, thank you for considering contributing to envcheck! It's people like you that make envcheck such a great tool.
This project and everyone participating in it is governed by our Code of Conduct. By participating, you are expected to uphold this code.
Before creating bug reports, please check the existing issues to avoid duplicates. When you create a bug report, include as many details as possible:
- Use a clear and descriptive title
- Describe the exact steps to reproduce the problem
- Provide your
.envcheck.yamlconfiguration - Include your OS and version
- Paste the full error message
Enhancement suggestions are tracked as GitHub issues. When creating an enhancement suggestion:
- Use a clear and descriptive title
- Provide a detailed description of the suggested enhancement
- Explain why this enhancement would be useful
- List some examples of how it would be used
Unsure where to begin? Look for issues labeled:
good first issue- Simple issues perfect for newcomershelp wanted- Issues where we need community help
- Fork the repo and create your branch from
main - Make your changes - follow the coding style below
- Add tests if you've added code that should be tested
- Ensure the test suite passes (
cargo test) - Run
cargo fmtto format your code - Run
cargo clippyto catch common mistakes - Write a good commit message
- Submit your pull request
# Clone your fork
git clone https://github.com/YOUR_USERNAME/envcheck.git
cd envcheck
# Build the project
cargo build
# Run tests
cargo test
# Run the tool locally
cargo run -- --help
# Format code
cargo fmt
# Lint code
cargo clippyenvcheck/
├── src/
│ ├── main.rs # CLI entry point
│ ├── config.rs # Config parsing
│ ├── validators/ # All validators
│ │ ├── mod.rs # Validator trait
│ │ ├── tool.rs # Tool checking
│ │ ├── env.rs # Env var checking
│ │ ├── port.rs # Port checking
│ │ └── file.rs # File checking
│ └── reporter.rs # Output formatting
└── tests/ # Integration tests
Want to add a new type of check? Here's how:
-
Create a new file in
src/validators/(e.g.,network.rs) -
Implement the
Validatortrait:
use crate::validators::{ValidationResult, Validator};
use anyhow::Result;
pub struct NetworkValidator {
host: String,
}
impl NetworkValidator {
pub fn new(host: String) -> Self {
Self { host }
}
}
impl Validator for NetworkValidator {
fn validate(&self) -> Result<Vec<ValidationResult>> {
let mut results = Vec::new();
// Your validation logic here
Ok(results)
}
}-
Add to
mod.rsand integrate intorun_all_validations -
Update the config schema in
config.rs -
Add tests for your validator
-
Update documentation in README.md
- Follow Rust conventions and idioms
- Use
cargo fmtfor formatting - Use
cargo clippyto catch common mistakes - Write clear, descriptive variable names
- Add comments for complex logic
- Keep functions small and focused
- Write unit tests for new functionality
- Add integration tests for end-to-end scenarios
- Ensure all tests pass before submitting PR
- Aim for high test coverage
# Run all tests
cargo test
# Run specific test
cargo test test_name
# Run with output
cargo test -- --nocapture- Use the present tense ("Add feature" not "Added feature")
- Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
- Limit the first line to 72 characters
- Reference issues and pull requests liberally
Examples:
Add support for Python version checkingFix port validation on WindowsUpdate README with new examples
Feel free to open an issue with your question or reach out to the maintainers.
Contributors will be recognized in our README and release notes. Thank you for making envcheck better!