mirror of
https://github.com/mimblewimble/grin.git
synced 2025-01-20 19:11:08 +03:00
docs: update for obsoleted usage of 'rustfmt', update 'Find us' (#1570)
This commit is contained in:
parent
8d62247c99
commit
7a187d5c98
1 changed files with 24 additions and 20 deletions
|
@ -6,17 +6,20 @@ The [list of issues](https://github.com/mimblewimble/grin/issues) is a good plac
|
|||
|
||||
Additional tests are rewarded with an immense amount of positive karma.
|
||||
|
||||
More documentation or updates/fixes to existing documentation are also very welcome. However, if submitting a PR consisting of documentation changes only, please try to ensure that the change is significantly more substantial than one or two lines. For example, working through an install document and making changes and updates throughout as you find issues is worth a PR. For typos and other small changes, either contact one of the developers, or if you think it's a significant enough error to cause problems for other users, please feel free to open an issue.
|
||||
More documentation or updates/fixes to existing documentation are also very welcome. However, if submitting a PR(Pull-Request) consisting of documentation changes only, please try to ensure that the change is significantly more substantial than one or two lines. For example, working through an install document and making changes and updates throughout as you find issues is worth a PR. For typos and other small changes, either contact one of the developers, or if you think it's a significant enough error to cause problems for other users, please feel free to open an issue.
|
||||
|
||||
Find us:
|
||||
# Find Us
|
||||
|
||||
If any help is needed during your effort to contribute on this project, please don't hesitate to contact us:
|
||||
* Chat: [Gitter](https://gitter.im/grin_community/Lobby).
|
||||
* [Forum](https://www.grin-forum.org/)
|
||||
* [Website](https://grin-tech.org)
|
||||
* Mailing list: join the [~MimbleWimble team](https://launchpad.net/~mimblewimble) and subscribe on Launchpad.
|
||||
* News: [Twitter](https://twitter.com/grinmw). Twitter bot that scrapes headlines, mailing list, and reddit posts related to MimbleWinble/Grin.
|
||||
|
||||
# Grin Style Guide
|
||||
|
||||
Grin uses `rustfmt` to maintain consistent formatting.
|
||||
Please use the git commit hook as explained below.
|
||||
Grin uses `rustfmt` to maintain consistent formatting, and we're using the git commit hook as explained below.
|
||||
|
||||
## Install rustfmt
|
||||
|
||||
|
@ -28,16 +31,11 @@ rustup update
|
|||
rustfmt --version
|
||||
```
|
||||
|
||||
and verify you did get version `0.3.4-nightly (6714a44 2017-12-23)` or newer.
|
||||
and verify you did get version `rustfmt 0.99.1-stable (da17b689 2018-08-04)` or newer.
|
||||
|
||||
## Install git pre-commit hook
|
||||
## Automatic "pre-commit hook"
|
||||
|
||||
There is a basic git [pre-commit](.hooks/pre-commit) hook in the repo.
|
||||
|
||||
The pre-commit hook will not prevent commits if style issues are present but it will
|
||||
indicate any files that need formatting.
|
||||
|
||||
This pre-commit hook will be **automatically** configured in this project, once you run `cargo build` for the 1st time.
|
||||
There is a basic git [pre-commit](.hooks/pre-commit) hook in the repo, and this pre-commit hook will be **automatically** configured in this project, once you run `cargo build` for the 1st time.
|
||||
|
||||
Or you can config it manually with the following command without building, and check it:
|
||||
```
|
||||
|
@ -49,20 +47,26 @@ The output will be:
|
|||
core.hookspath=./.hooks
|
||||
```
|
||||
|
||||
## Running rustfmt
|
||||
**Note**: The pre-commit hook will not prevent commits if style issues are present, instead it will indicate any files that need formatting, and it will automatically run `rustfmt` on your changed files, each time when you try to do `git commit`.
|
||||
|
||||
## Running rustfmt manually
|
||||
|
||||
You can run rustfmt (i.e. rustfmt-preview) on one file or on all files.
|
||||
|
||||
First try a dry-run on a file you've worked on, say:
|
||||
`rustfmt --write-mode diff -- client.rs`
|
||||
For example:
|
||||
```
|
||||
rustfmt client.rs
|
||||
```
|
||||
|
||||
Any errors or rustfmt failures? Fix those manually.
|
||||
**Notes**:
|
||||
1. *Please add the rustfmt corrections as a separate commit at the end of your Pull Request to make the reviewers happy.*
|
||||
|
||||
Then let rustfmt make any further changes and save you the work:
|
||||
2. *If you're still not sure about what should do on the format, please feel free to ignore it. Since `rustfmt` is just a tool to make your code having pretty formatting, your changed code is definitely more important than the format. Hope you're happy to contribute on this open source project!*
|
||||
|
||||
`rustfmt --write-mode overwrite -- client.rs`
|
||||
3. And anyway please don't use ~~`cargo +nightly fmt`~~ if at all possible.
|
||||
|
||||
*Please add the rustfmt corrections as a separate commit at the end of your Pull Request to make the reviewers happy.*
|
||||
## Thanks for any contribution
|
||||
|
||||
Even one word correction are welcome! Our objective is to encourage you to get interested in Grin and contribute in any way possible. Thanks for any help!
|
||||
|
||||
|
||||
And don't use ~~`cargo +nightly fmt`~~ if at all possible.
|
||||
|
|
Loading…
Reference in a new issue