Contributing
Contributions are welcome! This guide covers how to contribute to articwake.
Getting Started
Section titled “Getting Started”- Fork the repository on GitHub
- Clone your fork:
Terminal window git clone https://github.com/YOUR-USERNAME/articwake.gitcd articwake - Create a branch:
Terminal window git checkout -b feature/your-feature-name
Development Setup
Section titled “Development Setup”Requirements
Section titled “Requirements”- Rust 1.85+ (edition 2024)
- Docker (for cross-compilation)
Building
Section titled “Building”cargo buildRunning Tests
Section titled “Running Tests”cargo testLinting
Section titled “Linting”cargo clippy -- -D warningscargo fmt -- --checkCode Style
Section titled “Code Style”Formatting
Section titled “Formatting”All code must be formatted with rustfmt:
cargo fmtLinting
Section titled “Linting”All clippy warnings must be resolved:
cargo clippy -- -D warningsNaming Conventions
Section titled “Naming Conventions”- Modules:
snake_case - Functions:
snake_case - Types:
PascalCase - Constants:
SCREAMING_SNAKE_CASE
Error Handling
Section titled “Error Handling”Use thiserror for custom error types:
#[derive(Debug, Error)]pub enum MyError { #[error("Something went wrong: {0}")] SomethingFailed(String),}Pull Request Process
Section titled “Pull Request Process”- Ensure tests pass:
cargo test - Ensure linting passes:
cargo clippy -- -D warnings - Ensure formatting:
cargo fmt - Write descriptive commits: Explain what and why
- Open a PR: Describe changes and motivation
PR Title Format
Section titled “PR Title Format”Use conventional commit style:
feat: add new featurefix: resolve bug in Xdocs: update READMErefactor: restructure module Ytest: add tests for Z
PR Description
Section titled “PR Description”Include:
- What changes were made
- Why the changes were made
- How to test the changes
- Any breaking changes
Testing Guidelines
Section titled “Testing Guidelines”Unit Tests
Section titled “Unit Tests”Add tests for new functionality:
#[cfg(test)]mod tests { use super::*;
#[test] fn test_new_function() { // Arrange let input = "test";
// Act let result = new_function(input);
// Assert assert!(result.is_ok()); }}Coverage
Section titled “Coverage”Aim to test:
- Happy path
- Edge cases
- Error conditions
Documentation
Section titled “Documentation”Code Comments
Section titled “Code Comments”Comment complex logic, not obvious code:
// BAD: Increments countercounter += 1;
// GOOD: Rate limit window resets after 60 secondsif elapsed > RATE_LIMIT_WINDOW { entry.attempts.clear();}Doc Comments
Section titled “Doc Comments”Add doc comments for public APIs:
/// Validates a MAC address format.////// Accepts colon-separated, dash-separated, or no separator.////// # Examples////// ```/// assert!(validate_mac("aa:bb:cc:dd:ee:ff").is_ok());/// ```pub fn validate_mac(mac: &str) -> Result<(), ConfigError> { // ...}Areas for Contribution
Section titled “Areas for Contribution”Good First Issues
Section titled “Good First Issues”- Improve error messages
- Add more unit tests
- Documentation improvements
- Code comments
Feature Ideas
Section titled “Feature Ideas”- Additional status checks
- Webhook notifications
- Multiple server support
- Audit logging
Bug Fixes
Section titled “Bug Fixes”Check the issue tracker for reported bugs.
License
Section titled “License”By contributing, you agree that your contributions will be licensed under the MIT License.
Questions?
Section titled “Questions?”Open an issue for questions or discussion before starting large changes.