forked from rerun-io/rerun
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve CONTRIBUTING.md (rerun-io#774)
* Expand `CONTRIBUTING.md` with what to contribute, and how to get started * Move instructions from how to run examples to examples/README.md * Remove dummy README.md * Link to the main setup section * Remove extra word
- Loading branch information
Showing
4 changed files
with
47 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,13 +3,26 @@ This is written for anyone who wants to contribute to the Rerun repository. | |
|
||
Rerun is an open core company, and this repository is dual-licensed under MIT and APACHE. However, this repository is NOT YET open source, but IT WILL BE. Therefore we ask you to avoid making public clones of this repository, but in other respects treat it as any other open source GitHub project. | ||
|
||
## Setup | ||
First up, you need to install the Rust toolchain: <https://rustup.rs/>. Then run `./scripts/setup_dev.sh`. | ||
## What to contribute | ||
* **Examples**: We welcome any examples you would like to add. Follow the pattern of the existing examples in the [`examples/`](examples) folder. | ||
|
||
## Structure | ||
The main crates are found in the `crates/` folder, with examples in the `examples/` folder. | ||
* **Bug reports and issues**: Open them at <https://github.com/rerun-io/rerun/issues>. | ||
|
||
You can also look at our [`good first issue` tag](https://github.com/rerun-io/rerun/labels/good%20first%20issue). | ||
|
||
## Pull Requests | ||
We use [Trunk Based Development](https://trunkbaseddevelopment.com/), which means we encourage small, short-lived branches. Open draft PR:s to get some early feedback on your work. | ||
|
||
All PR:s are merged with [`Squash and Merge`](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/incorporating-changes-from-a-pull-request/about-pull-request-merges#squash-and-merge-your-commits), meaning they all get squashed to just one commit on the `main` branch. This means you don't need to keep a clean commit history on your feature branches. In fact, it is preferable to add new commits to a branch rather than rebasing or squashing. For one, it makes it easier to track progress on a branch, but rebasing and force-pushing also discourages collaboration on a branch. | ||
|
||
Read about individual examples for details on how to run them. | ||
## Getting started with the repository. | ||
* Install the Rust toolchain: <https://rustup.rs/> | ||
* `git clone [email protected]:rerun-io/rerun.git && cd rerun` | ||
* Run `./scripts/setup_dev.sh`. | ||
* Make sure `cargo --version` prints `1.65.0` once you are done | ||
|
||
## Structure | ||
The main crates are found in the [`crates/`](crates) folder, with examples in the [`examples/`](examples) folder. | ||
|
||
To get an overview of the crates, read their documentation with: | ||
|
||
|
@@ -27,25 +40,20 @@ cargo run -p rerun -- --help | |
|
||
We use the [`just`](https://github.com/casey/just) command runner tool for repository automation. See [here](https://github.com/casey/just#installation) for installation instructions. To see available automations, use `just --list`. | ||
|
||
We use [cargo cranky](https://github.com/ericseppanen/cargo-cranky) and specify our clippy lints in `Cranky.toml`. Usage: `cargo cranky`. | ||
We use [cargo cranky](https://github.com/ericseppanen/cargo-cranky) and specify our clippy lints in [`Cranky.toml`](Cranky.toml). Usage: `cargo cranky`. | ||
|
||
We use [cargo deny](https://github.com/EmbarkStudios/cargo-deny) to check our dependency tree for copy-left licenses, duplicate dependencies and [rustsec advisories](https://rustsec.org/advisories). You can configure it in `deny.toml`. Usage: `cargo deny check`. | ||
|
||
Configure your editor to run `cargo fmt` on save. Also configure it to strip trailing whitespace, an to end each file with a newline. Settings for VSCode can be found in the `.vscode` folder and should be applied automatically. If you are using another editor, consider adding good setting to this repository! | ||
Configure your editor to run `cargo fmt` on save. Also configure it to strip trailing whitespace, and to end each file with a newline. Settings for VSCode can be found in the `.vscode` folder and should be applied automatically. If you are using another editor, consider adding good setting to this repository! | ||
|
||
To check everything in one go, run `./scripts/check.sh`. `check.sh` should ideally check approximately the same things as our CI. | ||
|
||
### Optional | ||
You can use [bacon](https://github.com/Canop/bacon) to automatically check your code on each save. For instance, running just `bacon` will re-run `cargo cranky` each time you change a rust file. See `bacon.toml` for more. | ||
You can use [bacon](https://github.com/Canop/bacon) to automatically check your code on each save. For instance, running just `bacon` will re-run `cargo cranky` each time you change a rust file. See [`bacon.toml`](bacon.toml) for more. | ||
|
||
### Other | ||
You can view higher log levels with `export RUST_LOG=debug` or `export RUST_LOG=trace`. | ||
|
||
## Pull Requests | ||
We use [Trunk Based Development](https://trunkbaseddevelopment.com/), which means we encourage small, short-lived branches. | ||
|
||
All PR:s are all merged with [`Squash and Merge`](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/incorporating-changes-from-a-pull-request/about-pull-request-merges#squash-and-merge-your-commits), meaning they all get squashed to just one commit on the `main` branch. This means you don't need to keep a clean commit history on your feature branches. In fact, it is preferable to add new commits to a branch rather than rebasing or squashing. For one, it makes it easier to track progress on a branch, and secondly it is more difficult to collaborate on a branch if one user is rebasing it. | ||
|
||
## Rust code | ||
|
||
### Error handling and logging | ||
|
@@ -142,9 +150,9 @@ Points, vectors, rays etc all live in different _spaces_. Whenever there is room | |
Here are some of our standard spaces: | ||
|
||
* `ui`: coordinate system used by `egui`, measured in logical pixels ("points"), with origin in the top left | ||
* `image`: image pixel coordinates, possibly with an added z=depth | ||
* `image`: image pixel coordinates, possibly with an added `z=depth` | ||
* `space`: a user-defined space where they log stuff into | ||
* `world`: the common coordinate system of a 3D screen, usually same as `space` | ||
* `world`: the common coordinate system of a 3D scene, usually same as `space` | ||
* `view`: X=right, Y=down, Z=back, origin = center of screen | ||
|
||
#### Matrices | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Rerun Examples | ||
## Setup | ||
First follow [the main setup instructions](https://github.com/rerun-io/rerun#setup). | ||
|
||
## Running the examples | ||
Each example comes with its own set of dependencies listed in a `requirements.txt` file. For example, to install dependencies and run the toy `car` example (which doesn't need to download any data) run: | ||
|
||
```sh | ||
pip install -r examples/car/requirements.txt | ||
examples/car/main.py | ||
``` | ||
|
||
You can also install all dependencies needed to run all examples with: | ||
|
||
```sh | ||
pip install -r examples/requirements.txt | ||
``` | ||
|
||
> Note: The `stable_diffusion` example requires installing `diffusers` and `transformers` directly from main. To install run `pip install -U -r examples/stable_diffusion/requirements.txt`. | ||
## Contributions welcome | ||
Feel free to open a PR to add a new example! | ||
|
||
See [`CONTRIBUTING.md`](../CONTRIBUTING.md) for details on how to contribute. |