aboutsummaryrefslogtreecommitdiff
path: root/CONTRIBUTING.md
diff options
context:
space:
mode:
authorQuentin <quentin@dufour.io>2021-09-17 10:06:51 +0200
committerQuentin <quentin@dufour.io>2021-09-17 10:06:51 +0200
commit2bbc9109991f8bb79a09a965a1d2779e1749b25b (patch)
tree57dcb5b115b854d651ac6f952466d4109bac2d45 /CONTRIBUTING.md
parentfa25c54e47decf9f323ba0c614f4d9de106626d5 (diff)
parentbf226d077ef2bea0567a7b36b4d25ce2d0b5191c (diff)
downloaddiplonat-2bbc9109991f8bb79a09a965a1d2779e1749b25b.tar.gz
diplonat-2bbc9109991f8bb79a09a965a1d2779e1749b25b.zip
Merge pull request 'added rustfmt, a guide about this, and a CI job to enforce code quality' (#10) from adrien/diplonat:meta/formating into main
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/diplonat/pulls/10
Diffstat (limited to 'CONTRIBUTING.md')
-rw-r--r--CONTRIBUTING.md34
1 files changed, 34 insertions, 0 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 0000000..f8de6cc
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,34 @@
+# Contributing to Diplonat
+
+## Development guidelines
+
+### Code formatting
+
+[Our CI pipeline](./.drone.yml) features a verification of the code format, using [rustfmt](https://github.com/rust-lang/rustfmt).
+
+#### Installing rustfmt
+
+You can run `rustfmt` with Rust 1.24 and above.
+
+To install:
+
+```
+rustup component add rustfmt
+```
+
+#### Usage
+
+To run on Diplonat, launch the following in the root directory:
+
+```
+cargo fmt --all
+```
+
+This will format the whole repository using the settigs defined in [`.rustfmt.toml`](./.rustfmt.toml): soft tabs of 2 spaces.
+
+#### Auto-format code
+
+You can automate formatting in a number of ways:
+
+* [Setup your IDE to use `rustfmt`](https://github.com/rust-lang/rustfmt#running-rustfmt-from-your-editor).
+* Setup a git hook to run `rustfmt` before each commit.