diff --git a/src/FSharpLint.Core/Framework/Utilities.fs b/src/FSharpLint.Core/Framework/Utilities.fs index 1a13c43cf..f2dd46693 100644 --- a/src/FSharpLint.Core/Framework/Utilities.fs +++ b/src/FSharpLint.Core/Framework/Utilities.fs @@ -98,7 +98,7 @@ module ExpressionUtilities = |> Array.length) |> Option.defaultValue 0 - /// Converts a AsynType to its string representation. + /// Converts a SynType to its string representation. let synTypeToString (text:string) = function | SynType.Tuple _ as synType -> tryFindTextOfRange synType.Range text @@ -113,14 +113,14 @@ module ExpressionUtilities = then typeStrings |> String.concat "," |> Some else None - /// Counts the number of comment lines preceeding the given range of text. + /// Counts the number of comment lines preceding the given range of text. let countPrecedingCommentLines (text:string) (startPos:pos) (endPos:pos) = let range = mkRange "" startPos endPos tryFindTextOfRange range text - |> Option.map (fun preceedingText -> + |> Option.map (fun precedingText -> let lines = - preceedingText.Split '\n' + precedingText.Split '\n' |> Array.rev |> Array.tail lines diff --git a/src/FSharpLint.Core/Rules/Conventions/NestedStatements.fs b/src/FSharpLint.Core/Rules/Conventions/NestedStatements.fs index a551521a6..8994230fa 100644 --- a/src/FSharpLint.Core/Rules/Conventions/NestedStatements.fs +++ b/src/FSharpLint.Core/Rules/Conventions/NestedStatements.fs @@ -16,7 +16,7 @@ let private error (depth:int) = /// Lambda wildcard arguments are named internally as _argN, a match is then generated for them in the AST. /// e.g. fun _ -> () is represented in the AST as fun _arg1 -> match _arg1 with | _ -> (). -/// This function returns true if the given match statement is compiler generated for a lmabda wildcard argument. +/// This function returns true if the given match statement is compiler generated for a lambda wildcard argument. let private isCompilerGeneratedMatch = function | SynExpr.Match(_, SynExpr.Ident(ident), _, _) when ident.idText.StartsWith("_arg") -> true | _ -> false @@ -61,7 +61,7 @@ let private distanceToCommonParent (syntaxArray:AbstractSyntaxArray.Node []) i j distance /// Is node a duplicate of a node in the AST containing ExtraSyntaxInfo -/// e.g. lambda arg being a duplicate of the lamdba. +/// e.g. lambda arg being a duplicate of the lambda. let isMetaData args node i = let parentIndex = args.SyntaxArray.[i].ParentIndex if parentIndex = i then false diff --git a/src/FSharpLint.Core/Rules/Formatting/Spacing/ClassMemberSpacing.fs b/src/FSharpLint.Core/Rules/Formatting/Spacing/ClassMemberSpacing.fs index aa04b1ebf..73221beea 100644 --- a/src/FSharpLint.Core/Rules/Formatting/Spacing/ClassMemberSpacing.fs +++ b/src/FSharpLint.Core/Rules/Formatting/Spacing/ClassMemberSpacing.fs @@ -14,8 +14,8 @@ let checkClassMemberSpacing (args:AstNodeRuleParams) (members:SynMemberDefns) = |> List.toArray |> Array.pairwise |> Array.choose (fun (memberOne, memberTwo) -> - let numPreceedingCommentLines = countPrecedingCommentLines args.FileContent memberOne.Range.End memberTwo.Range.Start - if memberTwo.Range.StartLine <> memberOne.Range.EndLine + 2 + numPreceedingCommentLines then + let numPrecedingCommentLines = countPrecedingCommentLines args.FileContent memberOne.Range.End memberTwo.Range.Start + if memberTwo.Range.StartLine <> memberOne.Range.EndLine + 2 + numPrecedingCommentLines then let intermediateRange = let startLine = memberOne.Range.EndLine + 1 let endLine = memberTwo.Range.StartLine diff --git a/src/FSharpLint.Core/Rules/Formatting/Spacing/ModuleDeclSpacing.fs b/src/FSharpLint.Core/Rules/Formatting/Spacing/ModuleDeclSpacing.fs index 8124592e2..00ddb4a88 100644 --- a/src/FSharpLint.Core/Rules/Formatting/Spacing/ModuleDeclSpacing.fs +++ b/src/FSharpLint.Core/Rules/Formatting/Spacing/ModuleDeclSpacing.fs @@ -16,8 +16,8 @@ let checkModuleDeclSpacing (args:AstNodeRuleParams) synModuleOrNamespace = |> List.toArray |> Array.pairwise |> Array.choose (fun (declOne, declTwo) -> - let numPreceedingCommentLines = countPrecedingCommentLines args.FileContent declOne.Range.End declTwo.Range.Start - if declTwo.Range.StartLine <> declOne.Range.EndLine + 3 + numPreceedingCommentLines then + let numPrecedingCommentLines = countPrecedingCommentLines args.FileContent declOne.Range.End declTwo.Range.Start + if declTwo.Range.StartLine <> declOne.Range.EndLine + 3 + numPrecedingCommentLines then let intermediateRange = let startLine = declOne.Range.EndLine + 1 let endLine = declTwo.Range.StartLine diff --git a/src/FSharpLint.Core/Text.resx b/src/FSharpLint.Core/Text.resx index 922ccbc0e..2a562bf04 100644 --- a/src/FSharpLint.Core/Text.resx +++ b/src/FSharpLint.Core/Text.resx @@ -280,7 +280,7 @@ Match clauses should be at the same indentation level. - If RHS of pattern match case is on newline, it should be indentend by one level. + If RHS of pattern match case is on newline, it should be indented by one level. Separate module declarations with 2 blank lines.