Skip to content

Commit 82b2baf

Browse files
committed
apply fantomas formatting
1 parent 15cf3ce commit 82b2baf

6 files changed

Lines changed: 76 additions & 25 deletions

File tree

src/FSharp.Data.DesignTime/Csv/CsvProvider.fs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,10 @@ type public CsvProvider(cfg: TypeProviderConfig) as this =
115115
unitsOfMeasureProvider
116116
)
117117
#if NET6_0_OR_GREATER
118-
if ProviderHelpers.runtimeSupportsNet6Types cfg.RuntimeAssembly then fields
119-
else fields |> List.map StructuralInference.downgradeNet6PrimitiveProperty
118+
if ProviderHelpers.runtimeSupportsNet6Types cfg.RuntimeAssembly then
119+
fields
120+
else
121+
fields |> List.map StructuralInference.downgradeNet6PrimitiveProperty
120122
#else
121123
fields
122124
#endif

src/FSharp.Data.DesignTime/Html/HtmlGenerator.fs

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,10 @@ module internal HtmlGenerator =
5555

5656
let columns =
5757
#if NET6_0_OR_GREATER
58-
if supportsNet6Types then rawColumns
59-
else rawColumns |> List.map StructuralInference.downgradeNet6PrimitiveProperty
58+
if supportsNet6Types then
59+
rawColumns
60+
else
61+
rawColumns |> List.map StructuralInference.downgradeNet6PrimitiveProperty
6062
#else
6163
rawColumns
6264
#endif
@@ -137,14 +139,21 @@ module internal HtmlGenerator =
137139

138140
create, tableType
139141

140-
let private createListType getListTypeName (inferenceParameters, missingValuesStr, cultureStr) supportsNet6Types (list: HtmlList) =
142+
let private createListType
143+
getListTypeName
144+
(inferenceParameters, missingValuesStr, cultureStr)
145+
supportsNet6Types
146+
(list: HtmlList)
147+
=
141148

142149
let rawColumns = HtmlInference.inferListType inferenceParameters list.Values
143150

144151
let columns =
145152
#if NET6_0_OR_GREATER
146-
if supportsNet6Types then rawColumns
147-
else StructuralInference.downgradeNet6Types rawColumns
153+
if supportsNet6Types then
154+
rawColumns
155+
else
156+
StructuralInference.downgradeNet6Types rawColumns
148157
#else
149158
rawColumns
150159
#endif
@@ -214,8 +223,10 @@ module internal HtmlGenerator =
214223

215224
let columns =
216225
#if NET6_0_OR_GREATER
217-
if supportsNet6Types then rawColumns
218-
else StructuralInference.downgradeNet6Types rawColumns
226+
if supportsNet6Types then
227+
rawColumns
228+
else
229+
StructuralInference.downgradeNet6Types rawColumns
219230
#else
220231
rawColumns
221232
#endif
@@ -329,7 +340,10 @@ module internal HtmlGenerator =
329340
match htmlObj with
330341
| Table table ->
331342
let containerType = getOrCreateContainer "Tables"
332-
let create, tableType = createTableType getTypeName parameters supportsNet6Types table
343+
344+
let create, tableType =
345+
createTableType getTypeName parameters supportsNet6Types table
346+
333347
htmlType.AddMember tableType
334348

335349
containerType.AddMember
@@ -352,7 +366,10 @@ module internal HtmlGenerator =
352366
)
353367
| DefinitionList definitionList ->
354368
let containerType = getOrCreateContainer "DefinitionLists"
355-
let tableType = createDefinitionListType getTypeName parameters supportsNet6Types definitionList
369+
370+
let tableType =
371+
createDefinitionListType getTypeName parameters supportsNet6Types definitionList
372+
356373
htmlType.AddMember tableType
357374

358375
containerType.AddMember

src/FSharp.Data.DesignTime/Html/HtmlProvider.fs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,12 @@ type public HtmlProvider(cfg: TypeProviderConfig) as this =
7070

7171
doc
7272
|> HtmlRuntime.getHtmlObjects (Some inferenceParameters) includeLayoutTables
73-
|> HtmlGenerator.generateTypes asm ns typeName (inferenceParameters, missingValuesStr, cultureStr) supportsNet6Types
73+
|> HtmlGenerator.generateTypes
74+
asm
75+
ns
76+
typeName
77+
(inferenceParameters, missingValuesStr, cultureStr)
78+
supportsNet6Types
7479

7580
use _holder = IO.logTime "TypeGeneration" sample
7681

src/FSharp.Data.DesignTime/Json/JsonProvider.fs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,10 @@ type public JsonProvider(cfg: TypeProviderConfig) as this =
100100
JsonInference.inferType unitsOfMeasureProvider inferenceMode cultureInfo "" sampleJson)
101101
|> Array.fold (StructuralInference.subtypeInfered false) InferedType.Top
102102
#if NET6_0_OR_GREATER
103-
if ProviderHelpers.runtimeSupportsNet6Types cfg.RuntimeAssembly then rawInfered
104-
else StructuralInference.downgradeNet6Types rawInfered
103+
if ProviderHelpers.runtimeSupportsNet6Types cfg.RuntimeAssembly then
104+
rawInfered
105+
else
106+
StructuralInference.downgradeNet6Types rawInfered
105107
#else
106108
rawInfered
107109
#endif

src/FSharp.Data.DesignTime/Xml/XmlProvider.fs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,13 @@ type public XmlProvider(cfg: TypeProviderConfig) as this =
7474
let inferedType =
7575
use _holder = IO.logTime "Inference" sample
7676

77-
let t = schemaSet |> XsdParsing.getElements |> List.ofSeq |> XsdInference.inferElements
77+
let t =
78+
schemaSet |> XsdParsing.getElements |> List.ofSeq |> XsdInference.inferElements
7879
#if NET6_0_OR_GREATER
79-
if ProviderHelpers.runtimeSupportsNet6Types cfg.RuntimeAssembly then t
80-
else StructuralInference.downgradeNet6Types t
80+
if ProviderHelpers.runtimeSupportsNet6Types cfg.RuntimeAssembly then
81+
t
82+
else
83+
StructuralInference.downgradeNet6Types t
8184
#else
8285
t
8386
#endif
@@ -129,8 +132,10 @@ type public XmlProvider(cfg: TypeProviderConfig) as this =
129132
globalInference
130133
|> Array.fold (StructuralInference.subtypeInfered false) InferedType.Top
131134
#if NET6_0_OR_GREATER
132-
if ProviderHelpers.runtimeSupportsNet6Types cfg.RuntimeAssembly then t
133-
else StructuralInference.downgradeNet6Types t
135+
if ProviderHelpers.runtimeSupportsNet6Types cfg.RuntimeAssembly then
136+
t
137+
else
138+
StructuralInference.downgradeNet6Types t
134139
#else
135140
t
136141
#endif

src/FSharp.Data.Runtime.Utilities/StructuralInference.fs

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,10 @@ let internal downgradeNet6Types (inferedType: InferedType) : InferedType =
645645
System.Collections.Generic.HashSet<InferedType>(
646646
{ new System.Collections.Generic.IEqualityComparer<InferedType> with
647647
member _.Equals(x, y) = obj.ReferenceEquals(x, y)
648-
member _.GetHashCode(x) = System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(x) })
648+
649+
member _.GetHashCode(x) =
650+
System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(x) }
651+
)
649652

650653
let rec convert infType =
651654
if not (visited.Add(infType)) then
@@ -660,13 +663,22 @@ let internal downgradeNet6Types (inferedType: InferedType) : InferedType =
660663
| InferedType.Collection(order, types) ->
661664
InferedType.Collection(
662665
order |> List.map downgradeTag,
663-
types |> Map.toSeq |> Seq.map (fun (k, (m, t)) -> downgradeTag k, (m, convert t)) |> Map.ofSeq)
666+
types
667+
|> Map.toSeq
668+
|> Seq.map (fun (k, (m, t)) -> downgradeTag k, (m, convert t))
669+
|> Map.ofSeq
670+
)
664671
| InferedType.Heterogeneous(types, containsOptional) ->
665672
InferedType.Heterogeneous(
666-
types |> Map.toSeq |> Seq.map (fun (k, t) -> downgradeTag k, convert t) |> Map.ofSeq,
667-
containsOptional)
673+
types
674+
|> Map.toSeq
675+
|> Seq.map (fun (k, t) -> downgradeTag k, convert t)
676+
|> Map.ofSeq,
677+
containsOptional
678+
)
668679
| InferedType.Json(innerType, optional) -> InferedType.Json(convert innerType, optional)
669680
| _ -> infType
681+
670682
result
671683

672684
convert inferedType
@@ -677,9 +689,17 @@ let internal downgradeNet6PrimitiveProperty (field: StructuralTypes.PrimitiveInf
677689
let v = field.Value
678690

679691
if v.InferedType = typeof<DateOnly> then
680-
{ field with Value = { v with InferedType = typeof<DateTime>; RuntimeType = typeof<DateTime> } }
692+
{ field with
693+
Value =
694+
{ v with
695+
InferedType = typeof<DateTime>
696+
RuntimeType = typeof<DateTime> } }
681697
elif v.InferedType = typeof<TimeOnly> then
682-
{ field with Value = { v with InferedType = typeof<TimeSpan>; RuntimeType = typeof<TimeSpan> } }
698+
{ field with
699+
Value =
700+
{ v with
701+
InferedType = typeof<TimeSpan>
702+
RuntimeType = typeof<TimeSpan> } }
683703
else
684704
field
685705
#endif

0 commit comments

Comments
 (0)