|
| 1 | +# EditorConfig is awesome: |
| 2 | +http://EditorConfig.org |
| 3 | + |
| 4 | +# top-most EditorConfig file |
| 5 | +root = true |
| 6 | + |
| 7 | +############################### |
| 8 | +# Core EditorConfig Options # |
| 9 | +############################### |
| 10 | +# All files |
| 11 | +[*] # Do not apply to all files not to break something |
| 12 | +guidelines = 120 dashed, 130 |
| 13 | +# Either crlf | lf, default is system-dependent (when not specified at all) |
| 14 | +# end_of_line=crlf |
| 15 | +# Remove whitespace at the end of any line |
| 16 | + |
| 17 | +# Visual Studio Solution Files |
| 18 | +[*.sln] |
| 19 | +indent_style = tab |
| 20 | + |
| 21 | +# Code files |
| 22 | +[*.{cs,csx,fs,fsi,fsx}] |
| 23 | +trim_trailing_whitespace = true |
| 24 | +insert_final_newline = true |
| 25 | +indent_style = space # default=space |
| 26 | +indent_size = 4 # default=4 |
| 27 | +charset = utf-8 |
| 28 | + |
| 29 | +# Project files and app specific XML files |
| 30 | +[*.{csproj,fsproj,shproj,sfproj,projitems,props,xaml,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}] |
| 31 | +trim_trailing_whitespace = true |
| 32 | +insert_final_newline = true |
| 33 | +indent_style = space |
| 34 | +indent_size = 2 |
| 35 | + |
| 36 | +# XML configuration files |
| 37 | +[{app.config,nuget.config,packages.config,web.config}] |
| 38 | +trim_trailing_whitespace = true |
| 39 | +insert_final_newline = true |
| 40 | +indent_style = space |
| 41 | +indent_size = 2 |
| 42 | + |
| 43 | +# XML files |
| 44 | +[*.xml] |
| 45 | +trim_trailing_whitespace = false # do not trim as it affects CData |
| 46 | +insert_final_newline = true |
| 47 | +indent_style = space |
| 48 | +indent_size = 2 |
| 49 | + |
| 50 | +# JSON and YAML files |
| 51 | +[*.{json,yml,yaml}] |
| 52 | +trim_trailing_whitespace = true |
| 53 | +insert_final_newline = true |
| 54 | +indent_style = space |
| 55 | +indent_size = 2 |
| 56 | + |
| 57 | +# Proto files |
| 58 | +[*.proto] |
| 59 | +trim_trailing_whitespace = true |
| 60 | +insert_final_newline = true |
| 61 | +indent_style = space |
| 62 | +indent_size = 4 |
| 63 | + |
| 64 | +# Markdown Files |
| 65 | +[*.{md,mdx}] |
| 66 | +trim_trailing_whitespace = false |
| 67 | + |
| 68 | +# Bash Files |
| 69 | +[*.{sh}] |
| 70 | +end_of_line = lf |
| 71 | + |
| 72 | +# Batch Files |
| 73 | +[*.{cmd,bat}] |
| 74 | +end_of_line = crlf |
| 75 | + |
| 76 | +# Powershell Files |
| 77 | +[*.{ps1, psm1}] |
| 78 | +end_of_line = crlf |
| 79 | + |
| 80 | +# Paket files |
| 81 | +[paket.*] |
| 82 | +trim_trailing_whitespace = true |
| 83 | +indent_size = 2 |
| 84 | + |
| 85 | +[*.paket.references] |
| 86 | +trim_trailing_whitespace = true |
| 87 | +indent_size = 2 |
| 88 | + |
| 89 | +############################### |
| 90 | +# F# Coding Conventions # |
| 91 | +############################### |
| 92 | +# https://fsprojects.github.io/fantomas/docs/end-users/Configuration.html |
| 93 | + |
| 94 | +# filetypes that need to be formatted by Fantomas: |
| 95 | +[*.{fs,fsi,fsx}] |
| 96 | + |
| 97 | +# files to be ignored for Fantomas may go into this file, if present: |
| 98 | +# .fantomasignore |
| 99 | + |
| 100 | +# indentation size, default=4 |
| 101 | +indent_size=4 |
| 102 | + |
| 103 | +# line length before it gets broken down into multiple lines |
| 104 | +# default 120 |
| 105 | +max_line_length=130 |
| 106 | + |
| 107 | +# Either crlf | lf, default is system-dependent (when not specified at all) |
| 108 | +# end_of_line=crlf |
| 109 | + |
| 110 | +# Whether end-of-file has a newline, default=true |
| 111 | +insert_final_newline=true |
| 112 | + |
| 113 | +# false: someLineOfCode |
| 114 | +# true: someLineOfCode; |
| 115 | +# default false |
| 116 | +fsharp_semicolon_at_end_of_line=false |
| 117 | + |
| 118 | +# false: f(1,2) |
| 119 | +# true: f(1, 2) |
| 120 | +# default true |
| 121 | +fsharp_space_before_parameter=true |
| 122 | + |
| 123 | +# false: Option.map(fun x -> x) |
| 124 | +# true: Option.map (fun x -> x) |
| 125 | +# default true |
| 126 | +fsharp_space_before_lowercase_invocation=true |
| 127 | + |
| 128 | +# false: x.ToString() |
| 129 | +# true: x.ToString () |
| 130 | +# default false |
| 131 | +fsharp_space_before_uppercase_invocation=true |
| 132 | + |
| 133 | +# false: new Ship(withBeans) |
| 134 | +# true: new Ship (withBeans) |
| 135 | +# default false |
| 136 | +fsharp_space_before_class_constructor=true |
| 137 | + |
| 138 | +# false: __.member Foo(x) = x |
| 139 | +# true: __.member Foo (x) = x |
| 140 | +# default false |
| 141 | +fsharp_space_before_member=true |
| 142 | + |
| 143 | +# false: type Point = { x: int; y: int } |
| 144 | +# true: type Point = { x : int; y : int } |
| 145 | +# default false |
| 146 | +fsharp_space_before_colon=true |
| 147 | + |
| 148 | +# false: (a,b,c) |
| 149 | +# true: (a, b, c) |
| 150 | +# default true |
| 151 | +fsharp_space_after_comma=true |
| 152 | + |
| 153 | +# false: [a; b; 42] |
| 154 | +# true: [a ; b ; 42] |
| 155 | +# default false |
| 156 | +fsharp_space_before_semicolon=false |
| 157 | + |
| 158 | +# false: [a;b;42] |
| 159 | +# true: [a; b; 42] |
| 160 | +# default true |
| 161 | +fsharp_space_after_semicolon=true |
| 162 | + |
| 163 | +# false: let a = [1;2;3] |
| 164 | +# true: let a = [ 1;2;3 ] |
| 165 | +# default true |
| 166 | +fsharp_space_around_delimiter=true |
| 167 | + |
| 168 | +# breaks an if-then-else in smaller parts if it is on one line |
| 169 | +# default 40 |
| 170 | +fsharp_max_if_then_else_short_width=60 |
| 171 | + |
| 172 | +# breaks an infix operator expression if it is on one line |
| 173 | +# infix: a + b + c |
| 174 | +# default 50 |
| 175 | +fsharp_max_infix_operator_expression=60 |
| 176 | + |
| 177 | +# breaks a single-line record declaration |
| 178 | +# i.e. if this gets too wide: { X = 10; Y = 12 } |
| 179 | +# default 40 |
| 180 | +fsharp_max_record_width=80 |
| 181 | + |
| 182 | +# breaks a record into one item per line if items exceed this number |
| 183 | +# i.e. if set to 1, this will be on three lines: { X = 10; Y = 12 } |
| 184 | +# requires fsharp_record_multiline_formatter=number_of_items to take effect |
| 185 | +# default 1 |
| 186 | +fsharp_max_record_number_of_items=1 |
| 187 | + |
| 188 | +# whether to use line-length (by counting chars) or items (by counting fields) |
| 189 | +# for the record settings above |
| 190 | +# either number_of_items or character_width |
| 191 | +# default character_width |
| 192 | +fsharp_record_multiline_formatter=character_width |
| 193 | + |
| 194 | +# breaks a single line array or list if it exceeds this size |
| 195 | +# default 40 |
| 196 | +fsharp_max_array_or_list_width=100 |
| 197 | + |
| 198 | +# breaks an array or list into one item per line if items exceeds this number |
| 199 | +# i.e. if set to 1, this will be shown on three lines [1; 2; 3] |
| 200 | +# requires fsharp_array_or_list_multiline_formatter=number_of_items to take effect |
| 201 | +# default 1 |
| 202 | +fsharp_max_array_or_list_number_of_items=1 |
| 203 | + |
| 204 | +# whether to use line-length (by counting chars) or items (by counting fields) |
| 205 | +# for the list and array settings above |
| 206 | +# either number_of_items or character_width |
| 207 | +# default character_width |
| 208 | +fsharp_array_or_list_multiline_formatter=character_width |
| 209 | + |
| 210 | +# maximum with of a value binding, does not include keyword "let" |
| 211 | +# default 80 |
| 212 | +fsharp_max_value_binding_width=100 |
| 213 | + |
| 214 | +# maximum width for function and member binding (rh-side) |
| 215 | +# default 40 |
| 216 | +fsharp_max_function_binding_width=80 |
| 217 | + |
| 218 | +# maximum width for expressions like X.DoY().GetZ(10).Help() |
| 219 | +# default 50 |
| 220 | +fsharp_max_dot_get_expression_width=80 |
| 221 | + |
| 222 | +# whether open/close brackets go on the same column |
| 223 | +# cramped: type Range = |
| 224 | +# { From: float |
| 225 | +# To: float } |
| 226 | +# aligned: type Range = |
| 227 | +# { |
| 228 | +# From: float |
| 229 | +# To: float |
| 230 | +# } |
| 231 | +# stroustrup: type Range = { |
| 232 | +# From: float |
| 233 | +# To: float |
| 234 | +# } |
| 235 | +# default cramped |
| 236 | +fsharp_multiline_bracket_style=stroustrup |
| 237 | + |
| 238 | +# whether to move the beginning of compuitation expression to the new line |
| 239 | +# true: let x = |
| 240 | +# computation { |
| 241 | +# ... |
| 242 | +# } |
| 243 | +# false: let x = computation { |
| 244 | +# .. |
| 245 | +# } |
| 246 | +fsharp_newline_before_multiline_computation_expression=false |
| 247 | + |
| 248 | +# whether a newline should be placed before members |
| 249 | +# false: type Range = |
| 250 | +# { From: float } |
| 251 | +# member this.Length = this.To - this.From |
| 252 | +# true: type Range = |
| 253 | +# { From: float } |
| 254 | +# |
| 255 | +# member this.Length = this.To - this.From |
| 256 | +# default false |
| 257 | +fsharp_newline_between_type_definition_and_members=true |
| 258 | + |
| 259 | +# if a function sign exceeds max_line_length, then: |
| 260 | +# false: do not place the equal-sign on a single line |
| 261 | +# true: place the equal-sign on a single line |
| 262 | +# default false |
| 263 | +fsharp_align_function_signature_to_indentation=false |
| 264 | + |
| 265 | +# see docs: https://github.com/fsprojects/fantomas/blob/master/docs/Documentation.md#fsharp_alternative_long_member_definitions |
| 266 | +# default false |
| 267 | +fsharp_alternative_long_member_definitions=true |
| 268 | + |
| 269 | +# places closing paren in lambda on a newline in multiline lambdas |
| 270 | +# default false |
| 271 | +fsharp_multi_line_lambda_closing_newline=true |
| 272 | + |
| 273 | +# allows the 'else'-branch to be aligned at same level as 'else' if the ret type allows it |
| 274 | +# false: match x with |
| 275 | +# | null -> () |
| 276 | +# | _ -> () |
| 277 | +# true: match x with |
| 278 | +# | null -> () |
| 279 | +# | _ -> |
| 280 | +# () |
| 281 | +# default false |
| 282 | +fsharp_keep_indent_in_branch=true |
| 283 | + |
| 284 | +# whether a bar is placed before DU |
| 285 | +# false: type MyDU = Short of int |
| 286 | +# true: type MyDU = | Short of int |
| 287 | +# default false |
| 288 | +fsharp_bar_before_discriminated_union_declaration=false |
| 289 | + |
| 290 | +# multiline, nested expressions must be surrounded by blank lines |
| 291 | +# default true |
| 292 | +fsharp_blank_lines_around_nested_multiline_expressions=false |
| 293 | + |
| 294 | +# set maximal number of consecutive blank lines to keep from original source |
| 295 | +# it doesn't change number of new blank lines generated by Fantomas |
| 296 | +fsharp_keep_max_number_of_blank_lines=2 |
0 commit comments