-
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.
add contributing file + .rustfmt.toml file (#13)
- Loading branch information
1 parent
9eadfa8
commit ec61ab2
Showing
4 changed files
with
64 additions
and
4 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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
max_width = 100 | ||
comment_width = 80 | ||
wrap_comments = true | ||
imports_granularity = "Crate" | ||
use_small_heuristics = "Default" | ||
group_imports = "StdExternalCrate" | ||
format_strings = true |
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,55 @@ | ||
# Contributing code to text-redaction | ||
|
||
Everyone is welcome to contribute code to `text-redaction`, provided that they are willing to license their contributions under the same license as the project itself. | ||
We follow a simple 'inbound=outbound' model for contributions: the act of submitting an 'inbound' contribution means that the contributor agrees to license the code under the same terms as the project's overall 'outbound' license - in this case, Apache Software License v2 (see [LICENSE](./LICENSE)). | ||
|
||
|
||
## How to contribute | ||
|
||
The preferred and easiest way to contribute changes to the project is to fork it on GitHub, and then create a pull request to ask us to pull your changes into our repo. | ||
|
||
Things that should go into your PR description: | ||
|
||
- References to any bugs fixed by the change | ||
- Notes for the reviewer that might help them to understand why the change is necessary or how they might better review it | ||
|
||
Your PR must also: | ||
|
||
- be based on the `main` branch | ||
- adhere to the [code style](#code-style) | ||
- pass the [test suites](#tests) | ||
|
||
|
||
## Tests | ||
|
||
In `text-redaction` we have few test suite flows that need to pass before merging to master. | ||
- [unitest](#unitest) | ||
- [clippy](#clippy) | ||
- [rustfmt](#rustfmt) | ||
|
||
### unitest | ||
|
||
run the following command: | ||
```bash | ||
cargo xtask test | ||
``` | ||
|
||
To capture the snapshots test we using [insta](https://github.com/mitsuhiko/insta) rust project. you can see the snapshot changes / new snapshot by running the command: | ||
```bash | ||
cargo insta test --review | ||
``` | ||
|
||
### clippy | ||
```bash | ||
cargo xtask clippy | ||
``` | ||
|
||
### rustfmt | ||
```bash | ||
cargo xtask clippy | ||
``` | ||
|
||
## Code style | ||
|
||
We use the standard Rust code style, and enforce it with `rustfmt`/`cargo fmt`. | ||
A few code style options are set in the [`.rustfmt.toml`](./.rustfmt.toml) file, and some of them are not stable yet and require a nightly version of rustfmt. |
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 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