aboutsummaryrefslogtreecommitdiffhomepage
path: root/CONTRIBUTING.md
diff options
context:
space:
mode:
authorCalvin Rose <calsrose@gmail.com>2019-02-19 20:59:34 -0500
committerCalvin Rose <calsrose@gmail.com>2019-02-19 20:59:34 -0500
commitc022a1cf1a96d55ba5396d247def6db071d350aa (patch)
tree2a7d972f48bf7254634708af05f4377682c5fd88 /CONTRIBUTING.md
parentAdd make format to format code. (diff)
Add astyle guidelines to the contributing document.
Diffstat (limited to 'CONTRIBUTING.md')
-rw-r--r--CONTRIBUTING.md12
1 files changed, 11 insertions, 1 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 4a4911b6..8b8f3515 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -29,7 +29,12 @@ may require changes before being merged.
run tests with `make test`. If you want to add a new test suite, simply add a file to
the test folder and make sure it is run when`make test` is invoked.
* Be consistent with the style. For C this means follow the indentation and style in
- other files (files have MIT license at top, 4 spaces indentation, no trailing whitespace, cuddled brackets, etc.)
+ other files (files have MIT license at top, 4 spaces indentation, no trailing
+ whitespace, cuddled brackets, etc.) Use `make format` to
+ automatically format your C code with
+ [astyle](http://astyle.sourceforge.net/astyle.html). You will probably need
+ to install this, but it can be installed with most package managers.
+
For janet code, the use lisp indentation with 2 spaces. One can use janet.vim to
do this indentation, or approximate as close as possible.
@@ -51,6 +56,11 @@ Code should compile warning free and run valgrind clean. I find that these two c
of the easiest ways to protect against a large number of bugs in an unsafe language like C. To check for
valgrind errors, run `make valtest` and check the output for undefined or flagged behavior.
+### Formatting
+
+Use [astyle](http://astyle.sourceforge.net/astyle.html) via `make format` to
+ensure a consistent code style for C.
+
## Janet style
All janet code in the project should be formatted similar to the code in core.janet.