forked from Deducteam/lambdapi
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added CONTRIBUTING.md (fixes issue Deducteam#42).
- Loading branch information
Rodolphe Lepigre
committed
May 2, 2018
1 parent
14e3580
commit 01792e1
Showing
1 changed file
with
53 additions
and
0 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,53 @@ | ||
Contributing to Lambdapi | ||
======================== | ||
|
||
Here are a few guidelines for contributions. | ||
|
||
|
||
General style and indentation | ||
----------------------------- | ||
|
||
In the interest of code source uniformity, we ask that: | ||
- the *tabulation character should be banned*, | ||
- one indentation unit is equal to two spaces, | ||
- there should be *no trailing spaces* at the end of lines, | ||
- lines length should be limited to *78 characters* (excluding newline). | ||
|
||
|
||
Type annotations and interface | ||
------------------------------ | ||
|
||
Lambdapi does not use interface (or `.mli`) files. However, every function | ||
should be documented with its type, and an `ocamldoc` comment. We ask that | ||
the type of function is given with the following syntax (except for parsers | ||
defined in `src/parser.ml`). | ||
```ocaml | ||
(** [a_function x y z] does some things with [x], [y] and [z]. *) | ||
let a_function : int -> (bool -> bool) -> string -> unit = fun x y z -> | ||
... | ||
``` | ||
|
||
Note that `ocamldoc` comments should take up as much space as possible, | ||
without exceeding the maximum line width. Starting at their second line | ||
(if any), the begining of the lines should be aligned with the first word | ||
of the first line. | ||
|
||
|
||
Other conventions | ||
----------------- | ||
|
||
Pattern matching arrows should be aligned to improve readability, as in the | ||
following. | ||
```ocaml | ||
match ... with | ||
| A(x) -> ... | ||
| B(x,y) -> ... | ||
``` | ||
|
||
When the action of a patter does not fit on one line, it sould be indented | ||
by two unite (that is, four characters). | ||
```OCaml | ||
| A(x) -> | ||
>>>>let y = ... in | ||
>>>>... | ||
``` |