Mike Gerwitz

Activist for User Freedom

diff options
authorMike Gerwitz <mike.gerwitz@ryansg.com>2019-12-03 13:53:29 -0500
committerMike Gerwitz <mike.gerwitz@ryansg.com>2020-02-24 14:56:28 -0500
commit0acc21f16f098b2784b1382b82816889d694f91a (patch)
tree3910ff74a85e1b70bbcf83818d233f8caecf7214 /tamer/README.md
parente1076ce3880f5533cad311543f551a50be58c53e (diff)
Makefile.am (check): Check whether formatting is required
Given that developers should be doing TDD and therefore running this target frequently, this has the effect of providing immediate feedback when formatting is needed and outputting a diff. Developers will then quickly understand what changes need to be made to avoid future issues (and can run `cargo fmt` to fix it), at which point they'll rarely ever encounter formatting errors. The original purpose was to ensure pipelines fail when the formatter has not been run.
Diffstat (limited to 'tamer/README.md')
1 files changed, 31 insertions, 0 deletions
diff --git a/tamer/README.md b/tamer/README.md
index 6d44f02..2d14ef4 100644
--- a/tamer/README.md
+++ b/tamer/README.md
@@ -47,3 +47,34 @@ $ ./configure CARGO_BUILD_FLAGS=--release && make
$ ./configure && make
$ ./configure CARGO_BUILD_FLAGS=--release && make CARGO_BUILD_FLAGS=
+## Hacking
+This section contains advice for those developing TAMER.
+### Running Tests
+Developers should be using test-driven development (TDD). `make check` will
+run all necessary tests.
+### Code Format
+Rust provides `rustfmt` that can automatically format code for you. This
+project mandates its use and therefore eliminates personal preference in
+code style (for better or worse).
+Formatting checks are run during `make check` and, on failure, will output
+the diff that would be applied if you ran `make fmt` (or `make fix`); this
+will run `cargo fmt` for you (and will use the binaries configured via
+Since developers should be doing test-driven development (TDD) and therefore
+should be running `make check` frequently, the hope is that frequent
+feedback on formatting issues will allow developers to quickly adjust their
+habits to avoid triggering formatting errors at all.
+If you want to automatically fix formatting errors and then run tests:
+$ make fmt check