Skip to content

Commit c902ec4

Browse files
authored
acrolinx (#29279)
1 parent 68d0789 commit c902ec4

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

docs/fsharp/style-guide/formatting.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ let myOtherVeryLongValueName =
8585
The primary reasons for avoiding this are:
8686

8787
* Important code is moved far to the right
88-
* There is less width left for the actual code
88+
* There's less width left for the actual code
8989
* Renaming can break the alignment
9090

9191
### Avoid extraneous white space
@@ -175,7 +175,7 @@ let update model msg =
175175
| _ -> model, [ msg ]
176176
```
177177

178-
In summary, prefer parenthesized tuple instantiations, but when using tuples for pattern matching or a return value, it is considered fine to avoid parentheses.
178+
In summary, prefer parenthesized tuple instantiations, but when using tuples for pattern matching or a return value, it's considered fine to avoid parentheses.
179179

180180
### Formatting application expressions
181181

@@ -245,7 +245,7 @@ SomeClass.Invoke ()
245245
String.Format (x.IngredientName, x.Quantity)
246246
```
247247

248-
You may need to pass arguments to a function on a new line, as a matter of readability or because the list of arguments or the argument names are too long. In that case, indent one level:
248+
You may need to pass arguments to a function on a new line as a matter of readability or because the list of arguments or the argument names are too long. In that case, indent one level:
249249

250250
```fsharp
251251
// ✔️ OK
@@ -488,7 +488,7 @@ let subtractThenAdd x = x - 1 + 3
488488
```
489489

490490
Failing to surround a binary `-` operator, when combined with certain formatting choices, could lead to interpreting it as a unary `-`.
491-
Unary `-` operators should always be immediately followed by the value they are negating:
491+
Unary `-` operators should always be immediately followed by the value they negate:
492492

493493
```fsharp
494494
// ✔️ OK
@@ -842,7 +842,7 @@ let rainbow2 =
842842
```
843843

844844
You may want to dedicate separate lines for the braces and indent one scope to the right with the expression, however
845-
code formatters may . In some special cases, such as wrapping a value with an optional without parentheses, you may need to keep a brace on one line:
845+
code formatters may reformat it. In some special cases, such as wrapping a value with an optional without parentheses, you may need to keep a brace on one line:
846846

847847
```fsharp
848848
// ✔️ OK
@@ -989,7 +989,7 @@ let makeStreamReader x = new System.IO.StreamReader(path = x)
989989
let makeStreamReader x = new System.IO.StreamReader(path=x)
990990
```
991991

992-
When pattern matching using discriminated unions, named patterns are formatted similarly, e.g.
992+
When pattern matching using discriminated unions, named patterns are formatted similarly, for example.
993993

994994
```fsharp
995995
type Data =
@@ -1366,7 +1366,7 @@ type PostalAddress =
13661366
member x.ZipAndCity = $"{x.Zip} {x.City}"
13671367
```
13681368

1369-
Placing the opening token on a new line and the closing token on a new line is preferable if you are declaring interface implementations or members on the record:
1369+
Placing the opening token on a new line and the closing token on a new line is preferable if you're declaring interface implementations or members on the record:
13701370

13711371
```fsharp
13721372
// ✔️ OK
@@ -1496,7 +1496,7 @@ module A2 =
14961496
### Formatting do declarations
14971497

14981498
In type declarations, module declarations and computation expressions, the use of `do` or `do!` is sometimes required for side-effecting operations.
1499-
When these span multiple lines, use indentation and a new line to keep the indentation consistent with `let`/`let!`. Here is an example using `do` in a class:
1499+
When these span multiple lines, use indentation and a new line to keep the indentation consistent with `let`/`let!`. Here's an example using `do` in a class:
15001500

15011501
```fsharp
15021502
// ✔️ OK
@@ -1522,7 +1522,7 @@ type Foo () =
15221522
|> theQuickBrownFoxJumpedOverTheLazyDog
15231523
```
15241524

1525-
Here is an example with `do!` using two spaces of indentation (because with `do!` there is coincidentally no difference between the approaches when using four spaces of indentation):
1525+
Here's an example with `do!` using two spaces of indentation (because with `do!` there is coincidentally no difference between the approaches when using four spaces of indentation):
15261526

15271527
```fsharp
15281528
// ✔️ OK
@@ -1869,6 +1869,6 @@ type MyRecord =
18691869

18701870
When applied to a parameter, they must be on the same line and separated by a `;` separator.
18711871

1872-
### Acknowledgements
1872+
### Acknowledgments
18731873

18741874
These guidelines are based on [A comprehensive guide to F# Formatting Conventions](https://github.com/dungpa/fantomas/blob/master/docs/FormattingConventions.md) by [Anh-Dung Phan](https://github.com/dungpa).

0 commit comments

Comments
 (0)