Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check XML doc parameter names for FSharp.Core via opt-in checking #10118

Merged
merged 29 commits into from
Sep 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/absil/illib.fs
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,12 @@ module List =

let mapiFoldSquared f z xss = mapFoldSquared f z (xss |> mapiSquared (fun i j x -> (i, j, x)))

let duplicates (xs: 'T list) =
xs
|> List.groupBy id
|> List.filter (fun (_, elems) -> Seq.length elems > 1)
|> List.map fst

module ResizeArray =

/// Split a ResizeArray into an array of smaller chunks.
Expand Down
1 change: 1 addition & 0 deletions src/fsharp/CompileOps.fs
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,7 @@ let warningOn err level specificWarnOn =
| 1182 -> false // chkUnusedValue - off by default
| 3218 -> false // ArgumentsInSigAndImplMismatch - off by default
| 3180 -> false // abImplicitHeapAllocation - off by default
| 3390 -> false // xmlDocBadlyFormed - off by default
| _ -> level >= GetWarningLevel err

let SplitRelatedDiagnostics(err: PhasedDiagnostic) : PhasedDiagnostic * PhasedDiagnostic list =
Expand Down
7 changes: 7 additions & 0 deletions src/fsharp/FSComp.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1540,3 +1540,10 @@ forFormatInvalidForInterpolated4,"Interpolated strings used as type IFormattable
3382,parsEmptyFillInInterpolatedString,"Invalid interpolated string. This interpolated string expression fill is empty, an expression was expected."
3383,lexRBraceInInterpolatedString,"A '}}' character must be escaped (by doubling) in an interpolated string."
#3501 "This construct is not supported by your version of the F# compiler" CompilerMessage(ExperimentalAttributeMessages.NotSupportedYet, 3501, IsError=true)
3390,xmlDocBadlyFormed,"This XML comment is invalid: '%s'"
3390,xmlDocMissingParameterName,"This XML comment is invalid: missing 'name' attribute for parameter or parameter reference"
3390,xmlDocMissingCrossReference,"This XML comment is invalid: missing 'cref' attribute for cross-reference"
3390,xmlDocInvalidParameterName,"This XML comment is invalid: unknown parameter '%s'"
3390,xmlDocDuplicateParameter,"This XML comment is invalid: multiple documentation entries for parameter '%s'"
3390,xmlDocUnresolvedCrossReference,"This XML comment is invalid: unresolved cross-reference '%s'"
3390,xmlDocMissingParameter,"This XML comment is incomplete: no documentation for parameter '%s'"
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<DefineConstants>$(DefineConstants);COMPILER</DefineConstants>
<DefineConstants>$(DefineConstants);MSBUILD_AT_LEAST_15</DefineConstants>
<DefineConstants>$(DefineConstants);LOCALIZATION_FCOMP</DefineConstants>
<OtherFlags>$(OtherFlags) --warnon:1182 --maxerrors:20 --extraoptimizationloops:1</OtherFlags>
<OtherFlags>$(OtherFlags) --warnon:1182 /warnon:3390 --maxerrors:20 --extraoptimizationloops:1</OtherFlags>
<Tailcalls>true</Tailcalls> <!-- .tail annotations always emitted for this binary, even in debug mode -->
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<DefineConstants>$(DefineConstants);COMPILER_SERVICE_AS_DLL</DefineConstants>
<DefineConstants>$(DefineConstants);COMPILER</DefineConstants>
<DefineConstants>$(DefineConstants);ENABLE_MONO_SUPPORT</DefineConstants>
<OtherFlags>$(OtherFlags) /warnon:1182 --times</OtherFlags>
<OtherFlags>$(OtherFlags) /warnon:1182 /warnon:3390 --times</OtherFlags>
<Tailcalls>true</Tailcalls> <!-- .tail annotations always emitted for this binary, even in debug mode -->
<NGenBinary>true</NGenBinary>

Expand All @@ -21,7 +21,7 @@
<NuspecFile>FSharp.Compiler.Service.nuspec</NuspecFile>
<IsPackable Condition="'$(OS)' != 'Unix'">true</IsPackable>
<PackageDescription>The F# Compiler Services package For F# $(FSLanguageVersion) exposes additional functionality for implementing F# language bindings, additional tools based on the compiler or refactoring tools. The package also includes F# interactive service that can be used for embedding F# scripting into your applications. Contains code from the F# Software Foundation.</PackageDescription>
<PackageReleaseNotes>/blob/main/release-notes.md#FSharp-Compilere-Service-$(FSharpCompilerServiceReleaseNotesVersion)</PackageReleaseNotes>
<PackageReleaseNotes>/blob/main/release-notes.md#FSharp-Compiler-Service-$(FSharpCompilerServiceReleaseNotesVersion)</PackageReleaseNotes>
<PackageTags>F#, fsharp, interactive, compiler, editor</PackageTags>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion src/fsharp/FSharp.Core/FSharp.Core.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<AllowCrossTargeting>true</AllowCrossTargeting>
<DefineConstants>$(DefineConstants);FSHARP_CORE</DefineConstants>
<DefineConstants Condition="'$(Configuration)' == 'Proto'">BUILDING_WITH_LKG;$(DefineConstants)</DefineConstants>
<OtherFlags>$(OtherFlags) --warnon:1182 --compiling-fslib --compiling-fslib-40 --maxerrors:20 --extraoptimizationloops:1 --nowarn:57</OtherFlags>
<OtherFlags>$(OtherFlags) --warnon:1182 --warnon:3390 --compiling-fslib --compiling-fslib-40 --maxerrors:100 --extraoptimizationloops:1 --nowarn:57</OtherFlags>
<Tailcalls>true</Tailcalls> <!-- .tail annotations always emitted for this binary, even in debug mode -->
<NGenBinary>true</NGenBinary>

Expand Down
4 changes: 2 additions & 2 deletions src/fsharp/FSharp.Core/array.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -1010,7 +1010,7 @@ namespace Microsoft.FSharp.Collections
/// the remaining elements in a new array.</summary>
///
/// <param name="predicate">A function that evaluates an element of the array to a boolean value.</param>
/// <param name="source">The input array.</param>
/// <param name="array">The input array.</param>
///
/// <returns>The created sub array.</returns>
///
Expand Down Expand Up @@ -1293,7 +1293,7 @@ namespace Microsoft.FSharp.Collections
/// Returns <c>None</c> if index is negative or the input array does not contain enough elements.</summary>
///
/// <param name="index">The index of element to retrieve.</param>
/// <param name="source">The input array.</param>
/// <param name="array">The input array.</param>
///
/// <returns>The nth element of the array or <c>None</c>.</returns>
///
Expand Down
1 change: 1 addition & 0 deletions src/fsharp/FSharp.Core/async.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ namespace Microsoft.FSharp.Control
/// for the other child computations to complete.</remarks>
///
/// <param name="computations">A sequence of distinct computations to be parallelized.</param>
/// <param name="maxDegreeOfParallelism">The maximum degree of parallelism in the parallel execution.</param>
///
/// <returns>A computation that returns an array of values from the sequence of input computations.</returns>
///
Expand Down
2 changes: 1 addition & 1 deletion src/fsharp/FSharp.Core/eventmodule.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace Microsoft.FSharp.Control

/// <summary>Returns a new event that passes values transformed by the given function.</summary>
///
/// <param name="map">The function to transform event values.</param>
/// <param name="mapping">The function to transform event values.</param>
/// <param name="sourceEvent">The input event.</param>
///
/// <returns>An event that passes the transformed values.</returns>
Expand Down
2 changes: 1 addition & 1 deletion src/fsharp/FSharp.Core/list.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -956,7 +956,7 @@ namespace Microsoft.FSharp.Collections
/// <summary>Returns at most N elements in a new list.</summary>
///
/// <param name="count">The maximum number of items to return.</param>
/// <param name="array">The input list.</param>
/// <param name="list">The input list.</param>
///
/// <returns>The result list.</returns>
[<CompiledName("Truncate")>]
Expand Down
3 changes: 2 additions & 1 deletion src/fsharp/FSharp.Core/map.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ namespace Microsoft.FSharp.Collections
type Map<[<EqualityConditionalOn>]'Key,[<EqualityConditionalOn;ComparisonConditionalOn>]'Value when 'Key : comparison> =
/// <summary>Returns a new map with the binding added to the given map.
/// If a binding with the given key already exists in the input map, the existing binding is replaced by the new binding in the result map.</summary>
/// <param name="key">The input key.</param>
/// <param name="key">The key to add.</param>
/// <param name="value">The value to add.</param>
///
/// <returns>The resulting map.</returns>
member Add: key:'Key * value:'Value -> Map<'Key,'Value>
Expand Down
6 changes: 3 additions & 3 deletions src/fsharp/FSharp.Core/nativeptr.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ namespace Microsoft.FSharp.NativeInterop
/// <param name="address">The untyped pointer.</param>
///
/// <returns>A typed pointer.</returns>
val inline ofVoidPtr : voidptr -> nativeptr<'T>
val inline ofVoidPtr : address: voidptr -> nativeptr<'T>

[<Unverifiable>]
[<CompiledName("ToNativeIntInlined")>]
Expand Down Expand Up @@ -109,7 +109,7 @@ namespace Microsoft.FSharp.NativeInterop
/// <returns>A typed pointer to the allocated memory.</returns>
[<Unverifiable>]
[<CompiledName("StackAllocate")>]
val inline stackalloc : count:int -> nativeptr<'T>
val inline stackalloc: count:int -> nativeptr<'T>

/// <summary>Converts a given typed native pointer to a managed pointer.</summary>
///
Expand All @@ -118,4 +118,4 @@ namespace Microsoft.FSharp.NativeInterop
/// <returns>The managed pointer.</returns>
[<Unverifiable>]
[<CompiledName("ToByRefInlined")>]
val inline toByRef : nativeptr<'T> -> byref<'T>
val inline toByRef: address: nativeptr<'T> -> byref<'T>
2 changes: 1 addition & 1 deletion src/fsharp/FSharp.Core/observable.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ namespace Microsoft.FSharp.Control
/// each subscribed observer. The returned object also propagates error
/// observations arising from the source and completes when the source completes.</summary>
///
/// <param name="filter">The function to apply to observations to determine if it should
/// <param name="predicate">The function to apply to observations to determine if it should
/// be kept.</param>
/// <param name="source">The input Observable.</param>
///
Expand Down
Loading