mirror of
https://github.com/darkrenaissance/darkfi.git
synced 2026-01-09 14:48:08 -05:00
book/development: git etiquette
This commit is contained in:
@@ -1,11 +1,33 @@
|
||||
Notes for developers
|
||||
====================
|
||||
|
||||
## Making life easy for others
|
||||
|
||||
> **Write useful commit messages.**
|
||||
|
||||
If your commit is changing a specific module in the code and not
|
||||
touching other parts of the codebase (as should be the case 99% of the
|
||||
time), consider writing a useful commit message that also mentions
|
||||
which module was changed.
|
||||
|
||||
For example, a message like:
|
||||
|
||||
> `added foo`
|
||||
|
||||
is not as clear as
|
||||
|
||||
> `crypto/keypair: Added foo method for Bar struct.`
|
||||
|
||||
Also keep in mind that commit messages can be longer than a single
|
||||
line, so use it to your advantage to explain your commit and
|
||||
intentions.
|
||||
|
||||
|
||||
## cargo fmt pre-commit hook
|
||||
|
||||
To ensure every contributor uses the same code style, make sure
|
||||
you run `cargo fmt` before committing. You can force yourself to do
|
||||
this by creating a git `pre-commit` hook like the following:
|
||||
you run `cargo +nightly fmt` before committing. You can force yourself
|
||||
to do this by creating a git `pre-commit` hook like the following:
|
||||
|
||||
```shell
|
||||
#!/bin/sh
|
||||
|
||||
Reference in New Issue
Block a user