Fix stack overflow bug
[hiphop-php.git] / hphp / hack / src / .ocp-indent
blob4ae4492f0674c4bc3969fa74d262422aa83e61df
1 # -*- conf -*-
3 # Starting the configuration file with a preset ensures you won't fallback to
4 # definitions from "~/.ocp/ocp-indent.conf".
5 # These are `normal`, `apprentice` and `JaneStreet` and set different defaults.
6 normal
9 #    INDENTATION VALUES
12 # Number of spaces used in all base cases, for example:
13 #    let foo =
14 #    ^^bar
15 base = 2
17 # Indent for type definitions:
18 #    type t =
19 #    ^^int
20 type = 2
22 # Indent after `let in` (unless followed by another `let`):
23 #    let foo = () in
24 #    ^^bar
25 in = 0
27 # Indent after `match/try with` or `function`:
28 #    match foo with
29 #    ^^| _ -> bar
30 with = 0
32 # Indent for clauses inside a pattern-match (after the arrow):
33 #    match foo with
34 #    | _ ->
35 #    ^^^^bar
36 # the default is 2, which aligns the pattern and the expression
37 match_clause = 2
39 # When nesting expressions on the same line, their indentation are in
40 # some cases stacked, so that it remains correct if you close them one
41 # at a line. This may lead to large indents in complex code though, so
42 # this parameter can be used to set a maximum value. Note that it only
43 # affects indentation after function arrows and opening parens at end
44 # of line.
46 # for example (left: `none`; right: `4`)
47 #    let f = g (h (i (fun x ->     #    let f = g (h (i (fun x ->
48 #          x)                      #        x)
49 #        )                         #      )
50 #      )                           #    )
51 max_indent = 2
55 #    INDENTATION TOGGLES
58 # Whether the `with` parameter should be applied even when in a sub-block.
59 # Can be `always`, `never` or `auto`.
60 # if `always`, there are no exceptions
61 # if `auto`, the `with` parameter is superseded when seen fit (most of the time,
62 #            but not after `begin match` for example)
63 # if `never`, `with` is only applied if the match block starts a line.
65 # For example, the following is not indented if set to `always`:
66 #    let f = function
67 #    ^^| Foo -> bar
68 strict_with = never
70 # Controls indentation after the `else` keyword. `always` indents after the
71 # `else` keyword normally, like after `then`.
72 # If set to `never', the `else` keyword won't indent when followed by a newline.
73 # `auto` indents after `else` unless in a few "unclosable" cases (`let in`,
74 # `match`...).
76 # For example, with `strict_else=never`:
77 #    if cond then
78 #      foo
79 #    else
80 #    bar;
81 #    baz
82 # `never` is discouraged if you may encounter code like this example,
83 # because it hides the scoping error (`baz` is always executed)
84 strict_else = auto
86 # Ocp-indent will normally try to preserve your in-comment indentation, as long
87 # as it respects the left-margin or starts with `(*\n`. Setting this to `true`
88 # forces alignment within comments.
89 strict_comments = false
91 # Toggles preference of column-alignment over line indentation for most
92 # of the common operators and after mid-line opening parentheses.
94 # for example (left: `false'; right: `true')
95 #    let f x = x            #    let f x = x
96 #      + y                  #              + y
97 align_ops = false
99 # Function parameters are normally indented one level from the line containing
100 # the function. This option can be used to have them align relative to the
101 # column of the function body instead.
102 # if set to `always`, always align below the function
103 # if `auto`, only do that when seen fit (mainly, after arrows)
104 # if `never`, no alignment whatsoever
106 # for example (left: `never`; right: `always or `auto)
107 #    match foo with         #    match foo with
108 #    | _ -> some_fun        #    | _ -> some_fun
109 #      ^^parameter          #           ^^parameter
110 align_params = never
114 #    SYNTAX EXTENSIONS
117 # You can also add syntax extensions (as per the --syntax command-line option):
118 # syntax = mll