Skip to content

Commit c4f4e0d

Browse files
committed
mandatory Fantomas formatting commit
1 parent 495bc37 commit c4f4e0d

File tree

10 files changed

+33
-30
lines changed

10 files changed

+33
-30
lines changed

src/Common/Collections.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ module internal List =
4949
f x
5050
g ()
5151
iterInterleaved f g (y :: tl)
52-
| [x] -> f x
52+
| [ x ] -> f x
5353
| [] -> ()
5454

5555
/// Tests whether a list starts with the elements of another

src/Common/StringParsing.fs

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ module String =
1717
/// Matches when a string is a whitespace or null
1818
[<return: Struct>]
1919
let (|WhiteSpace|_|) (s) =
20-
if String.IsNullOrWhiteSpace(s) then ValueSome() else ValueNone
20+
if String.IsNullOrWhiteSpace(s) then
21+
ValueSome()
22+
else
23+
ValueNone
2124

2225
/// Returns a string trimmed from both start and end
2326
let (|TrimBoth|) (text: string) = text.Trim()
@@ -118,12 +121,15 @@ module String =
118121

119122
module StringPosition =
120123
/// Matches when a string is a whitespace or null
121-
[<return:Struct>]
124+
[<return: Struct>]
122125
let (|WhiteSpace|_|) (s, _n: MarkdownRange) =
123-
if String.IsNullOrWhiteSpace(s) then ValueSome() else ValueNone
126+
if String.IsNullOrWhiteSpace(s) then
127+
ValueSome()
128+
else
129+
ValueNone
124130

125131
/// Matches when a string does starts with non-whitespace
126-
[<return:Struct>]
132+
[<return: Struct>]
127133
let (|Unindented|_|) (s: string, _n: MarkdownRange) =
128134
if not (String.IsNullOrWhiteSpace(s)) && s.TrimStart() = s then
129135
ValueSome()
@@ -177,7 +183,7 @@ module StringPosition =
177183
StartColumn = n.StartColumn + text.Length - trimmed.Length })
178184

179185
/// Matches when a string starts with any of the specified sub-strings
180-
[<return:Struct>]
186+
[<return: Struct>]
181187
let (|StartsWithAny|_|) (starts: string seq) (text: string, _n: MarkdownRange) =
182188
if starts |> Seq.exists (fun s -> text.StartsWith(s, StringComparison.Ordinal)) then
183189
ValueSome()
@@ -301,7 +307,7 @@ module StringPosition =
301307

302308
/// Matches when a string consists of some number of
303309
/// complete repetitions of a specified sub-string.
304-
[<return:Struct>]
310+
[<return: Struct>]
305311
let (|EqualsRepeated|_|) (repeated, _n: MarkdownRange) =
306312
function
307313
| StartsWithRepeated repeated (_n, (v, _)) when (String.IsNullOrWhiteSpace v) -> ValueSome()
@@ -409,7 +415,7 @@ module Lines =
409415
lines
410416
// first remove all whitespace on the beginning of the line
411417
// then remove all additional spaces at the end, but keep two spaces if existent
412-
|> List.map (fun (StringPosition.TrimStart (s, n)) ->
418+
|> List.map (fun (StringPosition.TrimStart(s, n)) ->
413419
let endsWithTwoSpaces = s.EndsWith(" ", StringComparison.Ordinal)
414420

415421
let trimmed = s.TrimEnd([| ' ' |]) + if endsWithTwoSpaces then " " else ""

src/FSharp.Formatting.ApiDocs/GenerateModel.fs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ module internal Utils =
6262
else
6363
None
6464

65-
[<return:Struct>]
65+
[<return: Struct>]
6666
let (|MeasureOne|_|) (typ: FSharpType) =
6767
if
6868
typ.HasTypeDefinition
@@ -1758,7 +1758,7 @@ module internal SymbolReader =
17581758
[ let mutable line = ""
17591759

17601760
while (line <- reader.ReadLine()
1761-
not(isNull line)) do
1761+
not (isNull line)) do
17621762
yield line ]
17631763

17641764
String.removeSpaces lines
@@ -1906,14 +1906,14 @@ module internal SymbolReader =
19061906
let name = elem.Attribute(XName.Get "name")
19071907
let nameAsHtml = HttpUtility.HtmlEncode name.Value
19081908

1909-
if not(isNull name) then
1909+
if not (isNull name) then
19101910
html.AppendFormat("<span class=\"fsdocs-param-name\">{0}</span>", nameAsHtml)
19111911
|> ignore
19121912
| "see"
19131913
| "seealso" ->
19141914
let cref = elem.Attribute(XName.Get "cref")
19151915

1916-
if not(isNull cref) then
1916+
if not (isNull cref) then
19171917
if System.String.IsNullOrEmpty(cref.Value) || cref.Value.Length < 3 then
19181918
printfn "ignoring invalid cref specified in: %A" e
19191919

@@ -2019,7 +2019,7 @@ module internal SymbolReader =
20192019
let remarks =
20202020
let remarkNodes = doc.Elements(XName.Get "remarks") |> Seq.toList
20212021

2022-
if not(List.isEmpty remarkNodes) then
2022+
if not (List.isEmpty remarkNodes) then
20232023
let html = new StringBuilder()
20242024

20252025
for (id, e) in List.indexed remarkNodes do
@@ -2054,7 +2054,7 @@ module internal SymbolReader =
20542054
[ for e in exceptionNodes do
20552055
let cref = e.Attribute(XName.Get "cref")
20562056

2057-
if not(isNull cref) then
2057+
if not (isNull cref) then
20582058
if String.IsNullOrEmpty(cref.Value) || cref.Value.Length < 3 then
20592059
printfn "Warning: Invalid cref specified in: %A" doc
20602060

@@ -2822,7 +2822,7 @@ module internal SymbolReader =
28222822
[ for e in doc.Descendants(XName.Get "member") do
28232823
let attr = e.Attribute(XName.Get "name")
28242824

2825-
if (not(isNull attr)) && not (String.IsNullOrEmpty(attr.Value)) then
2825+
if (not (isNull attr)) && not (String.IsNullOrEmpty(attr.Value)) then
28262826
yield attr.Value, e ] do
28272827
// NOTE: We completely ignore duplicate keys and I don't see
28282828
// an easy way to detect where "value" is coming from, because the entries

src/FSharp.Formatting.CodeFormat/CodeFormatAgent.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ module CodeFormatter =
352352
[| let line = ref ""
353353

354354
while (line := reader.ReadLine()
355-
not(isNull line.Value)) do
355+
not (isNull line.Value)) do
356356
yield line.Value |]
357357
// Get options for a standalone script file (this adds some
358358
// default references and doesn't require full project information)

src/FSharp.Formatting.Common/Templating.fs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,7 @@ module internal SimpleTemplating =
284284
| true, lookupContent -> lookupContent
285285
| false, _ -> "")
286286
+ (match lookup.TryGetValue ParamKeys.``fsdocs-tooltips`` with
287-
| true, lookupTips ->
288-
"\n\n" + lookupTips
287+
| true, lookupTips -> "\n\n" + lookupTips
289288
| false, _ -> "")
290289
| Some templateText -> ApplySubstitutionsInText substitutions templateText
291290

src/FSharp.Formatting.Common/YaafFSharpScripting.fs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -247,10 +247,8 @@ module internal CompilerServiceExtensions =
247247
|> List.map (fun file ->
248248
file,
249249
(match referenceDict.TryGetValue file with
250-
| true, refFile ->
251-
Some refFile
252-
| false, _ ->
253-
None))
250+
| true, refFile -> Some refFile
251+
| false, _ -> None))
254252

255253
let getProjectReferencesSimple frameworkVersion (dllFiles: string list) =
256254
getProjectReferences frameworkVersion None None dllFiles |> resolve dllFiles
@@ -465,7 +463,7 @@ module internal ArgParser =
465463
else
466464
None
467465

468-
[<return:Struct>]
466+
[<return: Struct>]
469467
let (|FsiBoolArg|_|) argName s =
470468
match s with
471469
| StartsWith argName rest ->

src/FSharp.Formatting.Literate/ParseScript.fs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,9 @@ type internal ParseScript(parseOptions, ctx: CompilerContext) =
163163
| Command "condition" name when not (String.IsNullOrWhiteSpace name) -> { Condition = Some name }
164164
| _ -> { Condition = None }
165165

166-
[<return:Struct>]
167-
let (|EmptyString|_|) (v: string) = if v.Length = 0 then ValueSome() else ValueNone
166+
[<return: Struct>]
167+
let (|EmptyString|_|) (v: string) =
168+
if v.Length = 0 then ValueSome() else ValueNone
168169

169170
/// Transform list of code blocks (snippet/comment/command)
170171
/// into a formatted Markdown document, with link definitions
@@ -387,7 +388,7 @@ type internal ParseScript(parseOptions, ctx: CompilerContext) =
387388

388389
let parsedBlocks =
389390
[ for Snippet(name, lines) in sourceSnippets do
390-
if not(isNull name) then
391+
if not (isNull name) then
391392
yield BlockComment("## " + name)
392393

393394
yield! parseScriptFile (lines) ]

src/FSharp.Formatting.Literate/Transformations.fs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,7 @@ module internal Transformations =
7777
|> Array.toList
7878
|> String.removeSpaces
7979
|> String.concat "\n"
80-
| _ ->
81-
code
80+
| _ -> code
8281

8382
let lang =
8483
match language with

src/FSharp.Formatting.Markdown/Markdown.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ type Markdown internal () =
4545
let mutable lineNo = 1
4646

4747
while (line := reader.ReadLine()
48-
not(isNull line.Value)) do
48+
not (isNull line.Value)) do
4949
yield
5050
(line.Value,
5151
{ StartLine = lineNo

src/fsdocs-tool/ProjectCracker.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ module DotNetCli =
161161

162162
module Crack =
163163

164-
[<return:Struct>]
164+
[<return: Struct>]
165165
let (|ConditionEquals|_|) (str: string) (arg: string) =
166166
if System.String.Compare(str, arg, System.StringComparison.OrdinalIgnoreCase) = 0 then
167167
ValueSome()

0 commit comments

Comments
 (0)