From 21f3749425e5e6be1c4193dfcfe43dab7b8f7bf4 Mon Sep 17 00:00:00 2001 From: Mersho Date: Thu, 17 Aug 2023 16:27:53 +0330 Subject: [PATCH] FileConventions: `Contains()` is not suitable here --- src/FileConventions/Library.fs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/FileConventions/Library.fs b/src/FileConventions/Library.fs index c48b36cb..efa1ae90 100644 --- a/src/FileConventions/Library.fs +++ b/src/FileConventions/Library.fs @@ -415,10 +415,10 @@ let DoesNamespaceInclude (fileInfo: FileInfo) (word: string) = if fileText.Any() then let rightNamespace = - fileText - |> Seq.tryFind(fun x -> x.Contains "namespace" && x.Contains word) + fileText |> Seq.find(fun x -> x.Contains "namespace") - rightNamespace <> None + rightNamespace.Split().[1].Equals(word) + || rightNamespace.Split().[1].Equals(word + ";") else false