Skip to content

Commit

Permalink
feat: fantomizing
Browse files Browse the repository at this point in the history
  • Loading branch information
Natalie Perret committed Nov 25, 2024
1 parent 6e8aebe commit 9ca6ed4
Show file tree
Hide file tree
Showing 24 changed files with 2,123 additions and 1,802 deletions.
6 changes: 3 additions & 3 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
"version": 1,
"isRoot": true,
"tools": {
"dotnet-fsharplint": {
"version": "0.24.2",
"fantomas": {
"version": "6.2.3",
"commands": [
"dotnet-fsharplint"
"fantomas"
]
}
}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/on-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ jobs:
- name: Restore .NET Projects
run: dotnet restore
- name: Run F# Linter
run: dotnet fsharplint lint --lint-config fsharplint.json Vp.FSharp.Sql.sln
run: dotnet fantomas -r --check ./
- name: Run Tests
run: dotnet test
22 changes: 11 additions & 11 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<Project>

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<LangVersion>preview</LangVersion>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<MSBuildTreatWarningsAsErrors>true</MSBuildTreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<LangVersion>preview</LangVersion>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<MSBuildTreatWarningsAsErrors>true</MSBuildTreatWarningsAsErrors>
</PropertyGroup>

<PropertyGroup>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>$(NoWarn);1591;NU1903</NoWarn>
</PropertyGroup>
<PropertyGroup>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>$(NoWarn);1591;NU1903</NoWarn>
</PropertyGroup>

</Project>
</Project>
22 changes: 12 additions & 10 deletions Vp.FSharp.Sql.Tests/Helpers.fs
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ module FullCallCounter =
| ConnectionClosed _ -> incrConnectionClosed callCounter
| CommandPrepared _ -> incrCommandPrepared callCounter
| CommandExecuted _ -> incrCommandExecuted callCounter
let createOpenCallback (callCounter: FullCallCounter) = fun() -> incrOpenCall callCounter
let createCloseCallback (callCounter: FullCallCounter) = fun() -> incrCloseCall callCounter

let createOpenCallback (callCounter: FullCallCounter) = fun () -> incrOpenCall callCounter
let createCloseCallback (callCounter: FullCallCounter) = fun () -> incrCloseCall callCounter

let createCallbacks (callCounter: FullCallCounter) =
(createOpenCallback callCounter, createCloseCallback callCounter, createLoggerCallback callCounter)

Expand All @@ -53,7 +55,8 @@ module FullCallCounter =
CommandPrepared = commandPrepared
CommandExecuted = commandExecuted }

let initSame value = init value value value value value value
let initSame value =
init value value value value value value

let assertEqual
(actual: FullCallCounter)
Expand All @@ -62,7 +65,8 @@ module FullCallCounter =
expectedConnectionOpened
expectedConnectionClosed
expectedCommandPrepared
expectedCommandExecuted =
expectedCommandExecuted
=
actual.OpenCall =! expectedOpenCall
actual.CloseCall =! expectedCloseCall
actual.ConnectionOpened =! expectedConnectionOpened
Expand All @@ -82,8 +86,9 @@ module PartialCallCounter =
let incrCloseCall (callCounter: PartialCallCounter) =
callCounter.CloseCall <- callCounter.CloseCall + 1

let createOpenCallback (callCounter: PartialCallCounter) = fun() -> incrOpenCall callCounter
let createCloseCallback (callCounter: PartialCallCounter) = fun() -> incrCloseCall callCounter
let createOpenCallback (callCounter: PartialCallCounter) = fun () -> incrOpenCall callCounter
let createCloseCallback (callCounter: PartialCallCounter) = fun () -> incrCloseCall callCounter

let createCallbacks (callCounter: PartialCallCounter) =
(createOpenCallback callCounter, createCloseCallback callCounter)

Expand All @@ -93,9 +98,6 @@ module PartialCallCounter =

let initSame value = init value value

let assertEqual
(actual: PartialCallCounter)
expectedOpenCall
expectedCloseCall =
let assertEqual (actual: PartialCallCounter) expectedOpenCall expectedCloseCall =
actual.OpenCall =! expectedOpenCall
actual.CloseCall =! expectedCloseCall
Loading

0 comments on commit 9ca6ed4

Please sign in to comment.