Skip to content

Commit dc7091b

Browse files
committed
add verify docs target
1 parent 5c6f359 commit dc7091b

File tree

3 files changed

+59
-0
lines changed

3 files changed

+59
-0
lines changed

build/Build.fs

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,56 @@ open ReleaseTasks
1616

1717
initializeContext ()
1818

19+
open FSharp.Compiler.Diagnostics
20+
open BasicTasks
21+
22+
let verifyDocs =
23+
BuildTask.create "VerifyDocs" [ clean; build ] {
24+
let targets =
25+
!! "docs/**.fsx" |> Seq.map (fun f -> f.ToString())
26+
27+
let checker =
28+
FSharp.Compiler.CodeAnalysis.FSharpChecker.Create()
29+
30+
let ignoredDiagnostics = Set.ofList [ 1182 ] // unused variable
31+
32+
targets
33+
|> Seq.map (fun target ->
34+
checker.Compile(
35+
[|
36+
"fsc.exe"
37+
"-o"
38+
@"aaaaaaaaaaa.exe"
39+
"-a"
40+
target
41+
|]
42+
)
43+
|> Async.RunSynchronously
44+
|> fst
45+
|> Seq.where (fun diag ->
46+
match diag.Severity with
47+
| FSharpDiagnosticSeverity.Error
48+
| FSharpDiagnosticSeverity.Warning -> true
49+
| _ -> false))
50+
|> Seq.collect id
51+
|> Seq.where (fun c -> not (ignoredDiagnostics.Contains c.ErrorNumber))
52+
|> Seq.sortBy (fun diag ->
53+
(match diag.Severity with
54+
| FSharpDiagnosticSeverity.Error -> 0
55+
| _ -> 1),
56+
diag.FileName.[..6 (* to only count the numeric part *) ])
57+
|> Seq.map (fun diag ->
58+
(match diag.Severity with
59+
| FSharpDiagnosticSeverity.Error -> "--- Error: "
60+
| _ -> "--- Warning: ")
61+
+ diag.ToString())
62+
|> String.concat "\n"
63+
|> (fun errorText ->
64+
match errorText with
65+
| "" -> ()
66+
| text -> raise (System.Exception $"Errors:\n{text}"))
67+
}
68+
1969
let sourceFiles =
2070
!! "src/Plotly.NET/**/*.fs"
2171
++ "src/Plotly.NET.ImageExport/**/*.fs"

build/build.fsproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
<PackageReference Include="Fake.DotNet.MSBuild" Version="5.22.0" />
2828
<PackageReference Include="Fake.IO.FileSystem" Version="5.22.0" />
2929
<PackageReference Include="Fake.Tools.Git" Version="5.22.0" />
30+
<PackageReference Include="FSharp.Compiler.Service" Version="41.0.3" />
3031
</ItemGroup>
3132

3233
</Project>

src/Plotly.NET/Traces/Trace3D.fs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@ open System.Runtime.InteropServices
2121
///- surface and mesh: 3d surface trace types
2222
///- cone and streamtube: 3d vector field trace types
2323
///- volume and isosurface: 3d volume trace types
24+
///- scatter3d, which can be used to draw individual markers, 3d bubble charts and lines and curves
25+
///- surface and mesh: 3d surface trace types
26+
///- cone and streamtube: 3d vector field trace types
27+
///- volume and isosurface: 3d volume trace types
28+
///- scatter3d, which can be used to draw individual markers, 3d bubble charts and lines and curves
29+
///- surface and mesh: 3d surface trace types
30+
///- cone and streamtube: 3d vector field trace types
31+
///- volume and isosurface: 3d volume trace types
2432
2533
type Trace3D(traceTypeName) =
2634
inherit Trace(traceTypeName)

0 commit comments

Comments
 (0)