Thank you for your interest in contributing to the Supercluster project!
We welcome contributions from the community and appreciate your efforts to improve the project.
There are several ways you can contribute to the project:
If you encounter any bugs, please submit an issue with detailed information about the problem and steps to reproduce it. Include any relevant logs or screenshots that can help us understand the issue.
If you have ideas for new features, feel free to submit an issue with a detailed description of the feature and its potential use cases. We appreciate your input and will consider your suggestions for future releases.
Please note that this project is released with a Contributor Code of Conduct. By participating in this project, you agree to abide by its terms.
We welcome pull requests for bug fixes, new features, and improvements. To submit a pull request, follow these steps:
-
Fork the repository: Click the "Fork" button at the top right corner of the repository page to create a copy of the repository in your GitHub account.
-
Clone the repository: Clone your forked repository to your local machine using the following command:
git clone git@github.com:chargetrip/supercluster-rs.git
-
Create a new branch: Create a new branch for your changes using the following command:
git checkout -b my-feature-branch
-
Make your changes: Make the necessary changes to the codebase. Ensure that your code follows the project's coding standards and includes appropriate tests.
-
Commit your changes: Commit your changes with a descriptive commit message using the following command:
git commit -m "feat: description of my changes" -
Push your changes: Push your changes to your forked repository using the following command:
git push origin my-feature-branch
-
Create a pull request: Go to the original repository and click the
New pull requestbutton. Select your branch and provide a detailed description of your changes. Submit the pull request for review.
To build the project, run the following command:
cargo buildTo run the tests with all features, use:
cargo test --all-featuresTo run the tests with a specific feature, use:
cargo test --features cluster_metadataRun clippy to lint the code:
cargo clippy --locked --all-targets --all-features --no-deps -- -D warningsRun rustfmt to format the code:
cargo fmtGenerate documentation in HTML format:
cargo doc --openYou can run benchmarks locally for the changes you have made to the project.
The project uses criterion as its benchmarking tool.
To run a benchmark against the changes you have made, for example, you can run;
cd benches
# Run all benchmarks
cargo bench
# Run all tests in the `benches/supercluster_bench.rs` file
cargo bench --bench supercluster_bench
# After running benches, you can check the statistics under `target/criterion`We encourage contributors to create examples that demonstrate the features of the supercluster crate. Examples help users understand how to use the crate and provide practical use cases.
-
Create a new example file: Add a new file in the examples directory with a descriptive name, such as
examples/my_feature_example.rs. -
Write the example code: Write the code that demonstrates the feature. Ensure that the code is well-documented and includes comments explaining each step.
-
Test the example: Run the example to ensure it works as expected using the following command:
cargo run --example my_feature_example
-
Submit a pull request: Follow the steps in the
Submitting Pull Requestssection to submit your example.
To run an example, use the following command:
cargo run --example example_nameReplace example_name with the name of the example file (without the .rs extension).
If you need help or have any questions, feel free to submit an issue or reach out to the maintainers.
Thank you for contributing to Supercluster!