Skip to content

Commit

Permalink
add git-hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
Shourya742 committed Aug 27, 2024
1 parent 0666109 commit ac1d55f
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .githooks/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh
cargo fmt -- --check
if [ $? -ne 0 ]; then
echo "Rustfmt failed. Please format your code."
exit 1
fi

cargo clippy --workspace --all-targets -- -D warnings
if [ $? -ne 0 ]; then
echo "Clippy found issues. Please fix them."
exit 1
fi

echo "All checks passed. Proceeding with push..."
76 changes: 76 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<!-- omit in toc -->
# Contributing to Benchmarking tool

First off, thanks for taking the time to contribute! ❤️

All types of contributions are encouraged and valued. See the [Table of Contents](#table-of-contents) for different ways to help and details about how this project handles them. Please make sure to read the relevant section before making your contribution. It will make it a lot easier for us maintainers and smooth out the experience for all involved. The community looks forward to your contributions. 🎉

> And if you like the project, but just don't have time to contribute, that's fine. There are other easy ways to support the project and show your appreciation, which we would also be very happy about:
> - Star the project
> - Tweet about it
> - Refer this project in your project's readme
> - Mention the project at local meetups and tell your friends/colleagues
<!-- omit in toc -->
## Table of Contents

- [I Have a Question](#i-have-a-question)
- [I Want To Contribute](#i-want-to-contribute)
- [Project Communications](#project-communications)
- [Contribution workflow](#contribution-workflow)
- [Your First Code Contribution](#your-first-code-contribution)


## I Have a Question

> If you want to ask a question, we assume that you have read the documentation available in docs directory.
Best way to ask a question is to hop onto our community [Discord](https://discord.com/invite/fsEW23wFYs). The most suitable places to post a question are:
- #benchmarking-tool

If you then still feel the need to ask a question and need clarification, we recommend the following:

- Open an [Issue](https://github.com/stratum-mining/benchmarking-tool/issues).
- Provide as much context as you can about what you're running into.

We will then take care of the issue as soon as possible.

### Project Communications

Most project communications happen in our [Discord](https://discord.gg/fsEW23wFYs) server. Communications related to benchmarking-tool development typically happen under [benchmarking-tool](https://discord.gg/Kv6uucUq) channel.

Discussion about specific codebase work happens in GitHub [issues](https://github.com/stratum-mining/benchmarking-tool/issues) and on [pull requests](https://github.com/stratum-mining/benchmarking-tool/pulls).

Our dev calls are scheduled every Tuesday at 18.00 CET. You can see them in the sidebar under Events on Discord and subscribe to them to be notified.

## I Want To Contribute
> When contributing to this project, you must agree that you have authored 100% of the content, that you have the necessary rights to the content and that the content you contribute may be provided under the project license.

### Contribution workflow

The SRI project follows an open contributor model, where anyone is welcome to contribute through reviews, documentation, testing, and patches. Follow these steps to contribute:

1. **Fork the Repository**

2. **Setup git hooks**

`git config core.hooksPath .githooks`: This command sets the Git configuration to use the `.githooks` directory as the location for all Git hooks.

3. **Create a Branch**

4. **Commit Your Changes**

5. **Submit a Pull Request:** once you're satisfied with your changes, submit a pull request to the original SRI repository. Provide a clear and concise description of the changes you've made. If your pull request addresses an existing issue, reference the issue number in the description. In order to contribute to the protocol implementation, every PR must be opened against `dev` branch. To better understand which is the SRI branches structure, please have a look [here](https://github.com/stratum-mining/stratum/blob/main/RELEASE.md#principal-branches).

6. **Review and Iterate**

7. **Merge and Close:** Once your pull request has been approved and all discussions have been resolved, a project maintainer will merge your changes into the `main` branch. Your contribution will then be officially part of the project. The pull request will be closed, marking the completion of your contribution.

### Your First Code Contribution
>In order to contribute, a basic learning about git and github is needed. If you're not familiar with them, have a look at https://docs.github.com/en/get-started/start-your-journey/git-and-github-learning-resources to dig into and learn how to use them.
Unsure where to begin contributing to SRI? You can start by looking through `good first issue` and `help wanted` issues:

* [Good first issue](https://github.com/stratum-mining/stratum/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22) are issues which should only require a few lines of code, and a test or two.
* [Help wanted](https://github.com/stratum-mining/stratum/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22) - issues which should be a bit more involved than `good first issue` issues.

0 comments on commit ac1d55f

Please sign in to comment.