@@ -107,16 +107,14 @@ module IgnoreFiles =
107107 match remainingPath with
108108 | [_] when isDirectory -> false
109109 | currentSegment:: remaining ->
110- let currentlyMatchingGlobs = globs:: currentlyMatchingGlobs
110+ let updatedCurrentlyMatchingGlobs = getRemainingGlobSeqForMatches currentSegment ( globs:: currentlyMatchingGlobs)
111111
112- let currentlyMatchingGlobs = getRemainingGlobSeqForMatches currentSegment currentlyMatchingGlobs
113-
114- let aGlobWasCompletelyMatched = List.exists List.isEmpty currentlyMatchingGlobs
112+ let aGlobWasCompletelyMatched = List.exists List.isEmpty updatedCurrentlyMatchingGlobs
115113
116114 let matched = aGlobWasCompletelyMatched && ( isDirectory || ( not isDirectory && List.isEmpty remaining))
117115
118116 if matched then true
119- else doesGlobSeqMatchPathSeq globs isDirectory remaining currentlyMatchingGlobs
117+ else doesGlobSeqMatchPathSeq globs isDirectory remaining updatedCurrentlyMatchingGlobs
120118 | [] -> false
121119
122120 let private pathMatchesGlob ( globs : Regex list ) ( path : string list ) isDirectory =
@@ -692,7 +690,7 @@ let defaultConfiguration =
692690 use stream = assembly.GetManifestResourceStream( resourceName)
693691 match stream with
694692 | null -> failwithf " Resource '%s ' not found in assembly '%s '" resourceName ( assembly.FullName)
695- | stream ->
693+ | _ ->
696694 use reader = new System.IO.StreamReader( stream)
697695
698696 reader.ReadToEnd()
@@ -709,8 +707,8 @@ type LoadedRules =
709707 LineRules: LineRules
710708 DeprecatedRules: Rule [] }
711709
712- let getGlobalConfig ( globalConfig : GlobalConfig option ) =
713- globalConfig
710+ let getGlobalConfig ( maybeGlobalConfig : GlobalConfig option ) =
711+ maybeGlobalConfig
714712 |> Option.map ( fun globalConfig -> {
715713 Rules.GlobalRuleConfig.numIndentationSpaces = globalConfig.numIndentationSpaces |> Option.defaultValue Rules.GlobalRuleConfig.Default.numIndentationSpaces
716714 }) |> Option.defaultValue Rules.GlobalRuleConfig.Default
@@ -751,11 +749,11 @@ let findDeprecation config deprecatedAllRules allRules =
751749// fsharplint:disable MaxLinesInFunction
752750let flattenConfig ( config : Configuration ) =
753751 let parseHints ( hints : string []) =
754- let parseHint hint =
755- match FParsec.CharParsers.run HintParser.phint hint with
752+ let parseHint hintString =
753+ match FParsec.CharParsers.run HintParser.phint hintString with
756754 | FParsec.CharParsers.Success( hint, _, _) -> hint
757755 | FParsec.CharParsers.Failure( error, _, _) ->
758- raise <| ConfigurationException $" Failed to parse hint: {hint }{Environment.NewLine}{error}"
756+ raise <| ConfigurationException $" Failed to parse hint: {hintString }{Environment.NewLine}{error}"
759757
760758 hints
761759 |> Array.filter ( System.String.IsNullOrWhiteSpace >> not )
@@ -769,12 +767,12 @@ let flattenConfig (config:Configuration) =
769767 Array.concat
770768 [|
771769 // Deprecated grouped configs. TODO: remove in next major release
772- config.formatting |> Option.map ( fun config -> config .Flatten()) |> Option.toArray |> Array.concat
773- config.conventions |> Option.map ( fun config -> config .Flatten()) |> Option.toArray |> Array.concat
774- config.typography |> Option.map ( fun config -> config .Flatten()) |> Option.toArray |> Array.concat
770+ config.formatting |> Option.map ( fun formattingConfig -> formattingConfig .Flatten()) |> Option.toArray |> Array.concat
771+ config.conventions |> Option.map ( fun conventionsConfig -> conventionsConfig .Flatten()) |> Option.toArray |> Array.concat
772+ config.typography |> Option.map ( fun typographyConfig -> typographyConfig .Flatten()) |> Option.toArray |> Array.concat
775773 // </Deprecated>
776774
777- config.Hints |> Option.map ( fun config -> HintMatcher.rule { HintMatcher.Config.HintTrie = parseHints ( getOrEmptyList config .add) }) |> Option.toArray
775+ config.Hints |> Option.map ( fun hintsConfig -> HintMatcher.rule { HintMatcher.Config.HintTrie = parseHints ( getOrEmptyList hintsConfig .add) }) |> Option.toArray
778776 |]
779777
780778 let allRules =
0 commit comments