diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8216ab7498..8b5abcd140 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -10,6 +10,34 @@ To learn about the design of GreptimeDB, please refer to the [design docs](https - Make sure all unit tests are passed. - Make sure all clippy warnings are fixed (you can check it locally by running `cargo clippy --workspace --all-targets -- -D warnings -D clippy::print_stdout -D clippy::print_stderr`). + +#### `pre-commit` Hooks +You could setup the [`pre-commit`](https://pre-commit.com/#plugins) hooks to run these checks on every commit automatically. + +1. Install `pre-commit` +``` +$ pip install pre-commit +``` +or +``` +$ brew install pre-commit +``` + +2. Install the `pre-commit` hooks +``` +$ pre-commit install +pre-commit installed at .git/hooks/pre-commit + +$ pre-commit install --hook-type commit-msg +pre-commit installed at .git/hooks/commit-msg + +$ pre-commit install --hook-type pre-push +pre-commit installed at .git/hooks/pre-pus +``` + +now `pre-commit` will run automatically on `git commit`. + + ### Title The titles of pull requests should be prefixed with category name listed in [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0) @@ -32,4 +60,4 @@ of what you were trying to do and what went wrong. You can also reach for help i ## Bug report -To report a bug or a security issue, you can [open a new GitHub issue](https://github.com/GrepTimeTeam/greptimedb/issues/new). \ No newline at end of file +To report a bug or a security issue, you can [open a new GitHub issue](https://github.com/GrepTimeTeam/greptimedb/issues/new). diff --git a/README.md b/README.md index 54aa3476f4..ca4a6af06a 100644 --- a/README.md +++ b/README.md @@ -133,33 +133,6 @@ cargo run -- --log-dir=logs --log-level=debug frontend start -c ./config/fronten ``` You can delete your data by removing `/tmp/greptimedb`. -## Contribute +## Contributing -1. [Install rust](https://www.rust-lang.org/tools/install) -2. [Install `pre-commit`](https://pre-commit.com/#plugins) for run hooks on every commit automatically such as `cargo fmt` etc. - -``` -$ pip install pre-commit - -or - -$ brew install pre-commit -$ -``` - -3. Install the git hook scripts: - -``` -$ pre-commit install -pre-commit installed at .git/hooks/pre-commit - -$ pre-commit install --hook-type commit-msg -pre-commit installed at .git/hooks/commit-msg - -$ pre-commit install --hook-type pre-push -pre-commit installed at .git/hooks/pre-pus -``` - -now `pre-commit` will run automatically on `git commit`. - -4. Check out branch from `develop` and make your contribution. Follow the [style guide](https://github.com/GreptimeTeam/docs/blob/main/style-guide/zh.md). Create a PR when you are ready, feel free and have fun! +Please refer to [contribution guidelines](CONTRIBUTING.md) for more information.