Skip to content

Contributing

Contributions are welcome! This guide covers how to contribute to articwake.

  1. Fork the repository on GitHub
  2. Clone your fork:
    Terminal window
    git clone https://github.com/YOUR-USERNAME/articwake.git
    cd articwake
  3. Create a branch:
    Terminal window
    git checkout -b feature/your-feature-name
  • Rust 1.85+ (edition 2024)
  • Docker (for cross-compilation)
Terminal window
cargo build
Terminal window
cargo test
Terminal window
cargo clippy -- -D warnings
cargo fmt -- --check

All code must be formatted with rustfmt:

Terminal window
cargo fmt

All clippy warnings must be resolved:

Terminal window
cargo clippy -- -D warnings
  • Modules: snake_case
  • Functions: snake_case
  • Types: PascalCase
  • Constants: SCREAMING_SNAKE_CASE

Use thiserror for custom error types:

#[derive(Debug, Error)]
pub enum MyError {
#[error("Something went wrong: {0}")]
SomethingFailed(String),
}
  1. Ensure tests pass: cargo test
  2. Ensure linting passes: cargo clippy -- -D warnings
  3. Ensure formatting: cargo fmt
  4. Write descriptive commits: Explain what and why
  5. Open a PR: Describe changes and motivation

Use conventional commit style:

  • feat: add new feature
  • fix: resolve bug in X
  • docs: update README
  • refactor: restructure module Y
  • test: add tests for Z

Include:

  • What changes were made
  • Why the changes were made
  • How to test the changes
  • Any breaking changes

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());
}
}

Aim to test:

  • Happy path
  • Edge cases
  • Error conditions

Comment complex logic, not obvious code:

// BAD: Increments counter
counter += 1;
// GOOD: Rate limit window resets after 60 seconds
if elapsed > RATE_LIMIT_WINDOW {
entry.attempts.clear();
}

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> {
// ...
}
  • Improve error messages
  • Add more unit tests
  • Documentation improvements
  • Code comments
  • Additional status checks
  • Webhook notifications
  • Multiple server support
  • Audit logging

Check the issue tracker for reported bugs.

By contributing, you agree that your contributions will be licensed under the MIT License.

Open an issue for questions or discussion before starting large changes.