Skip to content

Commit

Permalink
Fix typos (#463)
Browse files Browse the repository at this point in the history
  • Loading branch information
auduchinok authored Sep 12, 2020
1 parent f1c306c commit bb4ef41
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions src/FSharpLint.Core/Framework/Utilities.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/FSharpLint.Core/Rules/Conventions/NestedStatements.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/FSharpLint.Core/Text.resx
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@
<value>Match clauses should be at the same indentation level.</value>
</data>
<data name="RulesFormattingMatchExpressionIndentationError" xml:space="preserve">
<value>If RHS of pattern match case is on newline, it should be indentend by one level.</value>
<value>If RHS of pattern match case is on newline, it should be indented by one level.</value>
</data>
<data name="RulesFormattingModuleDeclSpacingError" xml:space="preserve">
<value>Separate module declarations with 2 blank lines.</value>
Expand Down

0 comments on commit bb4ef41

Please sign in to comment.