Skip to content

Commit

Permalink
FileConventions: fix empty string false-positives
Browse files Browse the repository at this point in the history
Fix `DefiningEmptyStringsWithDoubleQuotes()` function by
using regex insted of `Contains()`.

Co-authored-by: Parham <[email protected]>
  • Loading branch information
Mersho and parhamsaremi committed Aug 29, 2023
1 parent 32eeacb commit f4ca0ca
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/FileConventions/Library.fs
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,9 @@ let IsExecutable(fileInfo: FileInfo) =

let DefiningEmptyStringsWithDoubleQuotes(fileInfo: FileInfo) =
let fileText = File.ReadAllText fileInfo.FullName
fileText.Contains "\"\""

Regex("(?<!\\\\)(?<!\\|\\s*)\"\"", RegexOptions.Compiled)
.IsMatch fileText

let ProjFilesNamingConvention(fileInfo: FileInfo) =
let regex = Regex "(.*)\..*proj$"
Expand Down

0 comments on commit f4ca0ca

Please sign in to comment.