|
| 1 | +# Contribution guide |
| 2 | + |
| 3 | +## How to contribute |
| 4 | + |
| 5 | +Please create an issue for discussion before submitting a pull request. This helps to ensure that your contribution |
| 6 | +aligns with the project's goals and standards, and allows maintainers to provide guidance on the implementation details. |
| 7 | + |
| 8 | +When submitting a pull request, please ensure that it includes: |
| 9 | + |
| 10 | +- A clear description of the changes made and the motivation behind them, as well as the link to the related issue. |
| 11 | +- Unit and integration tests for the new functionality or bug fixes, if applicable. |
| 12 | +- Documentation and examples updates, if the changes affect the public API or usage of the crate. |
| 13 | +- If the pull request is a work in progress, please mark it as such and indicate what is still needed to complete it. |
| 14 | + |
| 15 | +## Upgrading dependencies |
| 16 | + |
| 17 | +For security reasons, pull requests from external contributors that upgrade dependencies will not be accepted, unless a |
| 18 | +particular change is discussed in advance with the project maintainers. |
| 19 | + |
| 20 | +## Development workflow |
| 21 | + |
| 22 | +All commands assumed to be run from the root of the repository. |
| 23 | + |
| 24 | +### Environment |
| 25 | + |
| 26 | +- A fairly recent version of Rust, see `rust-version` in [Cargo.toml](./Cargo.toml). |
| 27 | +- Docker compose or a running ClickHouse server, accessible at `http://localhost:8123` with the `default` user and no |
| 28 | + password. |
| 29 | + |
| 30 | +### Start ClickHouse |
| 31 | + |
| 32 | +```sh |
| 33 | +docker compose up -d |
| 34 | +``` |
| 35 | + |
| 36 | +### Running tests |
| 37 | + |
| 38 | +To run all tests, you could use one of the following commands: |
| 39 | + |
| 40 | +```sh |
| 41 | +cargo test |
| 42 | +cargo test --no-default-features |
| 43 | +cargo test --all-features |
| 44 | +``` |
| 45 | + |
| 46 | +See also: [CI test commands](.github/workflows/ci.yml) |
| 47 | + |
| 48 | +### Documentation |
| 49 | + |
| 50 | +If you add a public API, please document it, as at a certain point the crate documentation will be enforced by the |
| 51 | +`missing_docs` lint rule. Additionally, consider adding runnable examples to the [examples directory](./examples) |
| 52 | +and to the [examples overview](./examples/README.md). |
| 53 | + |
| 54 | +Checking documentation can be done with: |
| 55 | + |
| 56 | +```sh |
| 57 | +cargo doc --all-features |
| 58 | +``` |
| 59 | + |
| 60 | +### Lint |
| 61 | + |
| 62 | +It is recommended to run Clippy before submitting a pull request. For example: |
| 63 | + |
| 64 | +```sh |
| 65 | +cargo clippy --all-targets --no-default-features |
| 66 | +cargo clippy --all-targets --all-features |
| 67 | +``` |
| 68 | + |
| 69 | +See also: [Clippy usage on CI](.github/workflows/ci.yml) |
| 70 | + |
| 71 | +### Benchmarks |
| 72 | + |
| 73 | +It is always a good idea to run benchmarks before submitting a pull request, especially if there are changes in the |
| 74 | +(de)serialization logic or in the transport layer. Check for more details in |
| 75 | +the [benchmarks overview](./benches/README.md) |
0 commit comments