Add CONTRIBUTING.md

This commit is contained in:
Konrad Borowski 2020-01-19 13:49:20 +01:00
parent d0d54ee4e2
commit 2e20de2a72

46
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,46 @@
# Bug reports
Use [the bug tracker](https://gitlab.com/pastebinrun/pastebinrun/issues).
If it's a security issue, ensure "This issue is confidential and should
only be visible to team members with at least Reporter access" is checked.
# Development
You need to have Node.js 12 and Rust 1.39 or higher installed. It's
recommended to use [`rustup`](https://rustup.rs/) for managing Rust
versions.
1. Install Node.js packages.
```sh
npm install
```
2. Run webpack. This will automatically rebuild JavaScript files on
every TypeScript change.
```sh
node_modules/.bin/webpack --watch
```
3. Run the project. Ensure that `DATABASE_URL` is set to a new
PostgreSQL database. Migrations will automatically run on it.
If you want to test sandbox, you will also need to set up
`SANDBOX_URL` environment variable.
For instance, if you have created a `pastebinrun` database, you
can run pastebin.run as follows.
```sh
env DATABASE_URL=postgresql:///pastebinrun cargo run
```
4. If a contribution adds new features, it's strongly encouraged
to add tests for those features.
5. Reformat your code before submitting merge request. Use latest
Rust stable for reformatting the code.
```sh
cargo fmt
```