Skip to content

Commit 0d1f13c

Browse files
committed
FileConvention: fix the function
Fix NotFollowingConsoleAppConvention() function.
1 parent a0a8e5a commit 0d1f13c

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
1-
async {
2-
do! Async.Sleep(5000)
3-
} |> Async.RunSynchronously
1+
async { do! Async.Sleep(5000) } |> Async.RunSynchronously
42
printf "Hello World"

src/FileConventions.Test/DummyFiles/DummyProjectAsync/Library.fs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,5 @@
33
module Say =
44

55
let delayedHello name =
6-
async {
7-
do! Async.Sleep(5000)
8-
} |> Async.RunSynchronously
6+
async { do! Async.Sleep(5000) } |> Async.RunSynchronously
97
"Delayed Hello"

src/FileConventions/Library.fs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,14 @@ let NotFollowingNamespaceConvention(fileInfo: FileInfo) =
465465

466466
let ContainsConsoleMethods(fileInfo: FileInfo) =
467467
let fileText = File.ReadAllText fileInfo.FullName
468-
let consoleMethods = [ "printf"; "Console." ]
468+
469+
let consoleMethods =
470+
[
471+
"printf"
472+
"Console."
473+
"Async.RunSynchronously"
474+
]
475+
469476
consoleMethods |> List.exists fileText.Contains
470477

471478

0 commit comments

Comments
 (0)