Contributing

We love contributions! Whether you have ideas, suggestions, or bug reports, feel free to open an issue or submit a pull request. Your input is essential to helping us improve macmon.

Setting Up the Development Environment

To get started with developing macmon, you'll need to set up the Rust toolchain and clone the repository.

  1. Install Rust: If you don't have it already, install the Rust toolchain from rust-lang.org.

    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
  2. Clone the Repository:

    git clone https://github.com/vladkens/macmon.git
    cd macmon

Building and Running

  • Build for Release: To create an optimized executable, use the following command. The binary will be located at target/release/macmon.
cargo build --release
  • Run for Development: To build and run the application directly, use:
cargo run --release
# Or for a quicker debug build:
# cargo run

Running Checks and Lints

Before submitting a pull request, please ensure your code passes all checks and adheres to the project's coding style. The Makefile provides a convenient lint command for this.

make lint

This command will run the following checks:

  1. cargo fmt --check: Ensures the code is formatted correctly.
  2. cargo clippy: Lints the code for common mistakes and style issues.
  3. cargo check: Compiles the project without producing a binary to check for errors.

Submitting Changes

  1. Fork the repository on GitHub.
  2. Create a new branch for your feature or bug fix.
  3. Commit your changes with clear and descriptive messages.
  4. Push your branch to your fork.
  5. Open a Pull Request to the main branch of the original repository.