Skip to content

Commit

Permalink
docs(README): recommend pre-commit Git hook (#414)
Browse files Browse the repository at this point in the history
  • Loading branch information
caugner authored Feb 5, 2024
1 parent aaecf0d commit ee07133
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,26 @@ Before you can start working with Rumba, you need to:
7. To create an authenticated session navigate to http://localhost:8000/users/fxa/login/authenticate/?next=%2F and login with your firefox staging account
8. To check you are logged in and ready to go navigate to http://localhost:8000/api/v1/whoami you should see your logged in user information.

## Formatting & Linting

All changes to Rumba are required to be formatted with [Rustfmt](https://doc.rust-lang.org/stable/clippy/index.html) (`cargo fmt --all`) and free of [Clippy](https://doc.rust-lang.org/stable/clippy/index.html) linting errors or warnings (`cargo clippy --all --all-features -- -D warnings`).

To avoid committing unformatted or unlinted changes, we recommend setting up a pre-commit [Git hook](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks) in your local repository checkout:

```sh
touch .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit
cat <<EOF >> .git/hooks/pre-commit
#!/usr/bin/env bash
echo "Running cargo fmt..."
cargo fmt --all -- --check
echo "Running cargo clippy..."
cargo clippy --all --all-features -- -D warnings
EOF
```

## Testing

See [tests](./tests/)

0 comments on commit ee07133

Please sign in to comment.