diff --git a/.editorconfig b/.editorconfig index 594dcb0ebde02b712c5458f03502cb2a78ccf570..5d68b1d516bee3f0a00d13ff750e64129e123851 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,6 +1,7 @@ root = true [*.fs] +max_line_length=140 fsharp_newline_between_type_definition_and_members=true fsharp_max_infix_operator_expression=80 fsharp_max_array_or_list_width=80 diff --git a/src/FSharp.Build/FSharpEmbedResXSource.fs b/src/FSharp.Build/FSharpEmbedResXSource.fs index 24665c44f5881d684fa9217355aab94ebb6aa98c..4318ff75e466fe203cd76da250fdcd3c0ee75f7f 100644 --- a/src/FSharp.Build/FSharpEmbedResXSource.fs +++ b/src/FSharp.Build/FSharpEmbedResXSource.fs @@ -98,9 +98,7 @@ module internal {1} = XElement(xname "summary", docComment) .ToString() .Split([| "\r\n"; "\r"; "\n" |], StringSplitOptions.None) - |> Array.fold - (fun (sb: StringBuilder) line -> sb.AppendLine(" /// " + line)) - (StringBuilder()) + |> Array.fold (fun (sb: StringBuilder) line -> sb.AppendLine(" /// " + line)) (StringBuilder()) // add the resource let accessorBody = match (generateLegacy, generateLiteral) with diff --git a/src/FSharp.Build/FSharpEmbedResourceText.fs b/src/FSharp.Build/FSharpEmbedResourceText.fs index eb1907187a872a5352ebbe9c821d551d80e42304..ede5581c02e9634de09e3cc381d3f22ee0a81ac9 100644 --- a/src/FSharp.Build/FSharpEmbedResourceText.fs +++ b/src/FSharp.Build/FSharpEmbedResourceText.fs @@ -175,12 +175,7 @@ type FSharpEmbedResourceText() = | 'f' -> AddHole "System.Double" | 's' -> AddHole "System.String" | '%' -> sb.Append('%') |> ignore - | c -> - Err( - fileName, - lineNum, - sprintf "'%%%c' is not a valid sequence, only %%d %%x %%X %%f %%s or %%%%" c - ) + | c -> Err(fileName, lineNum, sprintf "'%%%c' is not a valid sequence, only %%d %%x %%X %%f %%s or %%%%" c) i <- i + 2 else @@ -219,11 +214,7 @@ type FSharpEmbedResourceText() = i <- i + 1 // parse short identifier if i < txt.Length && not (System.Char.IsLetter(txt.[i])) then - Err( - fileName, - lineNum, - sprintf "The first character in the short identifier should be a letter, but found '%c'" txt.[i] - ) + Err(fileName, lineNum, sprintf "The first character in the short identifier should be a letter, but found '%c'" txt.[i]) while i < txt.Length && System.Char.IsLetterOrDigit txt.[i] do identB.Append txt.[i] |> ignore @@ -240,11 +231,7 @@ type FSharpEmbedResourceText() = i <- i + 1 if i = txt.Length then - Err( - fileName, - lineNum, - sprintf "After the identifier '%s' and comma, there should be the quoted string resource" ident - ) + Err(fileName, lineNum, sprintf "After the identifier '%s' and comma, there should be the quoted string resource" ident) else let str = try @@ -405,13 +392,7 @@ open Printf && (File.GetLastWriteTimeUtc(fileName) <= File.GetLastWriteTimeUtc(outXmlFileName)) if condition5 then - printMessage ( - sprintf - "Skipping generation of %s and %s from %s since up-to-date" - outFileName - outXmlFileName - fileName - ) + printMessage (sprintf "Skipping generation of %s and %s from %s since up-to-date" outFileName outXmlFileName fileName) Some(fileName, outFileName, outXmlFileName) else @@ -543,9 +524,7 @@ open Printf printMessage (sprintf "Generating .resx for %s" outFileName) fprintfn out "" // gen validation method - fprintfn - out - " /// Call this method once to validate that all known resources are valid; throws if not" + fprintfn out " /// Call this method once to validate that all known resources are valid; throws if not" fprintfn out " static member RunStartupValidation() =" diff --git a/src/FSharp.Build/MapSourceRoots.fs b/src/FSharp.Build/MapSourceRoots.fs index eb13aecad0bf2ad9f0b4177d900edf1acc184114..c2131209dad2fb7c0c1c6f5a406d50c9fcbb40f3 100644 --- a/src/FSharp.Build/MapSourceRoots.fs +++ b/src/FSharp.Build/MapSourceRoots.fs @@ -153,12 +153,8 @@ type MapSourceRoots() = // Since the paths in ItemSpec have backslashes replaced with slashes on non-Windows platforms we need to do the same for ContainingRoot. match topLevelMappedPaths.TryGetValue(Utilities.FixFilePath(containingRoot)) with | true, mappedTopLevelPath -> - root.SetMetadata( - MappedPath, - mappedTopLevelPath + ensureEndsWithSlash (nestedRoot.Replace('\\', '/')) - ) - | false, _ -> - log.LogError(FSBuild.SR.mapSourceRootsNoSuchTopLevelSourceRoot containingRoot) + root.SetMetadata(MappedPath, mappedTopLevelPath + ensureEndsWithSlash (nestedRoot.Replace('\\', '/'))) + | false, _ -> log.LogError(FSBuild.SR.mapSourceRootsNoSuchTopLevelSourceRoot containingRoot) | NullOrEmpty -> log.LogError(FSBuild.SR.mapSourceRootsNoSuchTopLevelSourceRoot "") | NullOrEmpty -> () else diff --git a/src/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.ProjectFile.fs b/src/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.ProjectFile.fs index 53b4c3723cb1cbc7ada7fad2a1c75cdf7d16e23e..e0d6660b99b7d2d77c141ef0ccae3b1bc3243cf9 100644 --- a/src/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.ProjectFile.fs +++ b/src/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.ProjectFile.fs @@ -96,9 +96,7 @@ module internal ProjectFile = let fields = line.Split(',') if fields.Length < 8 then - raise ( - InvalidOperationException(sprintf "Internal error - Invalid resolutions file format '%s'" line) - ) + raise (InvalidOperationException(sprintf "Internal error - Invalid resolutions file format '%s'" line)) else { NugetPackageId = fields[0] diff --git a/src/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.Utilities.fs b/src/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.Utilities.fs index 22e81c56a13a621f573ddaf2d647f433586b6abb..1e0aeebcb7bbfd1ac9225d6cc1513f9d7f9d737c 100644 --- a/src/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.Utilities.fs +++ b/src/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.Utilities.fs @@ -144,13 +144,7 @@ module internal Utilities = | None -> -1 let arguments prefix = - sprintf - "%s -restore %s %c%s%c /nologo /t:InteractivePackageManagement" - prefix - binLoggingArguments - '\"' - projectPath - '\"' + sprintf "%s -restore %s %c%s%c /nologo /t:InteractivePackageManagement" prefix binLoggingArguments '\"' projectPath '\"' let workingDir = Path.GetDirectoryName projectPath let dotnetHostPath = getDotnetHostPath () diff --git a/src/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.fs b/src/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.fs index 908f9cc5aa3b3ce3401247485b282d3c08d353ae..794aa5918744564052c6dbcd96d3be1ec6aaba49 100644 --- a/src/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.fs +++ b/src/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.fs @@ -58,20 +58,12 @@ module FSharpDependencyManager = p seq { - match not (String.IsNullOrEmpty(inc)), not (String.IsNullOrEmpty(ver)), not (String.IsNullOrEmpty(script)) - with - | true, true, false -> - yield sprintf @" " inc ver + match not (String.IsNullOrEmpty(inc)), not (String.IsNullOrEmpty(ver)), not (String.IsNullOrEmpty(script)) with + | true, true, false -> yield sprintf @" " inc ver | true, true, true -> - yield - sprintf - @" " - inc - ver - script + yield sprintf @" " inc ver script | true, false, false -> yield sprintf @" " inc - | true, false, true -> - yield sprintf @" " inc script + | true, false, true -> yield sprintf @" " inc script | _ -> () match not (String.IsNullOrEmpty(src)) with @@ -188,8 +180,7 @@ module FSharpDependencyManager = let mutable timeout = None lines - |> List.choose (fun line -> - parsePackageReferenceOption scriptExt (fun p -> binLogPath <- p) (fun t -> timeout <- t) line) + |> List.choose (fun line -> parsePackageReferenceOption scriptExt (fun p -> binLogPath <- p) (fun t -> timeout <- t) line) |> List.distinct |> (fun l -> l, binLogPath, timeout) @@ -202,8 +193,7 @@ module FSharpDependencyManager = match directive with | "i" -> sprintf "RestoreSources=%s" line | _ -> line) - |> List.choose (fun line -> - parsePackageReferenceOption scriptExt (fun p -> binLogPath <- p) (fun t -> timeout <- t) line) + |> List.choose (fun line -> parsePackageReferenceOption scriptExt (fun p -> binLogPath <- p) (fun t -> timeout <- t) line) |> List.distinct |> (fun l -> l, binLogPath, timeout) @@ -391,13 +381,7 @@ type FSharpDependencyManager(outputDirectory: string option) = let directiveLines = Seq.append packageManagerTextLines configIncludes let resolutionResult = - prepareDependencyResolutionFiles ( - scriptExt, - directiveLines, - targetFrameworkMoniker, - runtimeIdentifier, - timeout - ) + prepareDependencyResolutionFiles (scriptExt, directiveLines, targetFrameworkMoniker, runtimeIdentifier, timeout) match resolutionResult.resolutionsFile with | Some file -> @@ -425,13 +409,6 @@ type FSharpDependencyManager(outputDirectory: string option) = | None -> let empty = Seq.empty - ResolveDependenciesResult( - resolutionResult.success, - resolutionResult.stdOut, - resolutionResult.stdErr, - empty, - empty, - empty - ) + ResolveDependenciesResult(resolutionResult.success, resolutionResult.stdOut, resolutionResult.stdErr, empty, empty, empty) generateAndBuildProjectArtifacts :> obj diff --git a/src/fsi/console.fs b/src/fsi/console.fs index 88c453995672f43446838b47303054fdbd425e37..cd84b705b4af9bf7a4c28dbe2663954be8a71873 100644 --- a/src/fsi/console.fs +++ b/src/fsi/console.fs @@ -189,9 +189,7 @@ type internal ReadLineConsole() = if (lastDot < 0) then None, name, input.Substring(0, start) else - Some(name.Substring(0, lastDot)), - name.Substring(lastDot + 1), - input.Substring(0, start + lastDot + 1) + Some(name.Substring(0, lastDot)), name.Substring(lastDot + 1), input.Substring(0, start + lastDot + 1) try complete (attr, pref) diff --git a/src/fsi/fsimain.fs b/src/fsi/fsimain.fs index 3cad37941ace6367e0d65cd84bfa9694a4c34184..9df8f0cead4d66f2e280ab018f25f72d0cd79991 100644 --- a/src/fsi/fsimain.fs +++ b/src/fsi/fsimain.fs @@ -232,8 +232,7 @@ let evaluateSession (argv: string[]) = let fsiTy = fsiAssembly.GetType("FSharp.Compiler.Interactive.Settings") if isNull fsiAssembly then - failwith - "failed to find type FSharp.Compiler.Interactive.Settings in FSharp.Compiler.Interactive.Settings.dll" + failwith "failed to find type FSharp.Compiler.Interactive.Settings in FSharp.Compiler.Interactive.Settings.dll" Some(callStaticMethod fsiTy "get_fsi" [])