Skip to content

Commit

Permalink
FileConvention: fix the function
Browse files Browse the repository at this point in the history
Fix NotFollowingConsoleAppConvention() function.
  • Loading branch information
Mersho committed Aug 22, 2023
1 parent a0a8e5a commit 1342e1d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
async {
do! Async.Sleep(5000)
} |> Async.RunSynchronously
async { do! Async.Sleep(5000) } |> Async.RunSynchronously
printf "Hello World"
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,5 @@
module Say =

let delayedHello name =
async {
do! Async.Sleep(5000)
} |> Async.RunSynchronously
async { do! Async.Sleep(5000) } |> Async.RunSynchronously
"Delayed Hello"
9 changes: 8 additions & 1 deletion src/FileConventions/Library.fs
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,14 @@ let NotFollowingNamespaceConvention(fileInfo: FileInfo) =

let ContainsConsoleMethods(fileInfo: FileInfo) =
let fileText = File.ReadAllText fileInfo.FullName
let consoleMethods = [ "printf"; "Console." ]

let consoleMethods =
[
"printf"
"Console."
"Async.RunSynchronously"
]

consoleMethods |> List.exists fileText.Contains


Expand Down

0 comments on commit 1342e1d

Please sign in to comment.