Skip to content

Commit

Permalink
Npgsql.FSharp.Analyzer v3.23.0 fixe parser issue that wasn't able to …
Browse files Browse the repository at this point in the history
…pick up explicitly typed functions
  • Loading branch information
Zaid-Ajaj committed Mar 26, 2021
1 parent bc8bff1 commit 025b5de
Show file tree
Hide file tree
Showing 13 changed files with 85 additions and 74 deletions.
3 changes: 3 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
### 3.23.0 - 2021-03-26
* Detect typed let bindings

### 3.22.1 - 2021-02-09
* Let the analyzer continue its work when it comes across enum types

Expand Down
20 changes: 10 additions & 10 deletions src/FParsec/AssemblyInfo.fs
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ open System.Reflection

[<assembly: AssemblyTitleAttribute("FParsec")>]
[<assembly: AssemblyProductAttribute("NpgsqlFSharpAnalyzer")>]
[<assembly: AssemblyVersionAttribute("3.22.1")>]
[<assembly: AssemblyMetadataAttribute("ReleaseDate","2021-02-09T00:00:00.0000000")>]
[<assembly: AssemblyFileVersionAttribute("3.22.1")>]
[<assembly: AssemblyInformationalVersionAttribute("3.22.1")>]
[<assembly: AssemblyVersionAttribute("3.23.0")>]
[<assembly: AssemblyMetadataAttribute("ReleaseDate","2021-03-26T00:00:00.0000000")>]
[<assembly: AssemblyFileVersionAttribute("3.23.0")>]
[<assembly: AssemblyInformationalVersionAttribute("3.23.0")>]
[<assembly: AssemblyMetadataAttribute("ReleaseChannel","release")>]
[<assembly: AssemblyMetadataAttribute("GitHash","959f00c74c33e6cb5064595bf6107bcb11b215b3")>]
[<assembly: AssemblyMetadataAttribute("GitHash","bc8bff18abbd6b4cfd14b67738c9ec22a5412c90")>]
do ()

module internal AssemblyVersionInformation =
let [<Literal>] AssemblyTitle = "FParsec"
let [<Literal>] AssemblyProduct = "NpgsqlFSharpAnalyzer"
let [<Literal>] AssemblyVersion = "3.22.1"
let [<Literal>] AssemblyMetadata_ReleaseDate = "2021-02-09T00:00:00.0000000"
let [<Literal>] AssemblyFileVersion = "3.22.1"
let [<Literal>] AssemblyInformationalVersion = "3.22.1"
let [<Literal>] AssemblyVersion = "3.23.0"
let [<Literal>] AssemblyMetadata_ReleaseDate = "2021-03-26T00:00:00.0000000"
let [<Literal>] AssemblyFileVersion = "3.23.0"
let [<Literal>] AssemblyInformationalVersion = "3.23.0"
let [<Literal>] AssemblyMetadata_ReleaseChannel = "release"
let [<Literal>] AssemblyMetadata_GitHash = "959f00c74c33e6cb5064595bf6107bcb11b215b3"
let [<Literal>] AssemblyMetadata_GitHash = "bc8bff18abbd6b4cfd14b67738c9ec22a5412c90"
20 changes: 10 additions & 10 deletions src/NpgsqlFSharpAnalyzer.Core/AssemblyInfo.fs
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ open System.Reflection

[<assembly: AssemblyTitleAttribute("NpgsqlFSharpAnalyzer.Core")>]
[<assembly: AssemblyProductAttribute("NpgsqlFSharpAnalyzer")>]
[<assembly: AssemblyVersionAttribute("3.22.1")>]
[<assembly: AssemblyMetadataAttribute("ReleaseDate","2021-02-09T00:00:00.0000000")>]
[<assembly: AssemblyFileVersionAttribute("3.22.1")>]
[<assembly: AssemblyInformationalVersionAttribute("3.22.1")>]
[<assembly: AssemblyVersionAttribute("3.23.0")>]
[<assembly: AssemblyMetadataAttribute("ReleaseDate","2021-03-26T00:00:00.0000000")>]
[<assembly: AssemblyFileVersionAttribute("3.23.0")>]
[<assembly: AssemblyInformationalVersionAttribute("3.23.0")>]
[<assembly: AssemblyMetadataAttribute("ReleaseChannel","release")>]
[<assembly: AssemblyMetadataAttribute("GitHash","959f00c74c33e6cb5064595bf6107bcb11b215b3")>]
[<assembly: AssemblyMetadataAttribute("GitHash","bc8bff18abbd6b4cfd14b67738c9ec22a5412c90")>]
do ()

module internal AssemblyVersionInformation =
let [<Literal>] AssemblyTitle = "NpgsqlFSharpAnalyzer.Core"
let [<Literal>] AssemblyProduct = "NpgsqlFSharpAnalyzer"
let [<Literal>] AssemblyVersion = "3.22.1"
let [<Literal>] AssemblyMetadata_ReleaseDate = "2021-02-09T00:00:00.0000000"
let [<Literal>] AssemblyFileVersion = "3.22.1"
let [<Literal>] AssemblyInformationalVersion = "3.22.1"
let [<Literal>] AssemblyVersion = "3.23.0"
let [<Literal>] AssemblyMetadata_ReleaseDate = "2021-03-26T00:00:00.0000000"
let [<Literal>] AssemblyFileVersion = "3.23.0"
let [<Literal>] AssemblyInformationalVersion = "3.23.0"
let [<Literal>] AssemblyMetadata_ReleaseChannel = "release"
let [<Literal>] AssemblyMetadata_GitHash = "959f00c74c33e6cb5064595bf6107bcb11b215b3"
let [<Literal>] AssemblyMetadata_GitHash = "bc8bff18abbd6b4cfd14b67738c9ec22a5412c90"
2 changes: 2 additions & 0 deletions src/NpgsqlFSharpAnalyzer.Core/SyntacticAnalysis.fs
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,8 @@ module SyntacticAnalysis =
match expr with
| SynExpr.CompExpr(isArrayOrList, _, innerExpr, range) ->
visitSyntacticExpression innerExpr range
| SynExpr.Typed(innerExpr, returnType, range) ->
visitSyntacticExpression innerExpr range
| SynExpr.YieldOrReturn(_, innerExpr, innerRange) ->
visitSyntacticExpression innerExpr innerRange
| SynExpr.YieldOrReturnFrom(_, innerExpr, innerRange) ->
Expand Down
20 changes: 10 additions & 10 deletions src/NpgsqlFSharpAnalyzer/AssemblyInfo.fs
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ open System.Reflection

[<assembly: AssemblyTitleAttribute("NpgsqlFSharpAnalyzer")>]
[<assembly: AssemblyProductAttribute("NpgsqlFSharpAnalyzer")>]
[<assembly: AssemblyVersionAttribute("3.22.1")>]
[<assembly: AssemblyMetadataAttribute("ReleaseDate","2021-02-09T00:00:00.0000000")>]
[<assembly: AssemblyFileVersionAttribute("3.22.1")>]
[<assembly: AssemblyInformationalVersionAttribute("3.22.1")>]
[<assembly: AssemblyVersionAttribute("3.23.0")>]
[<assembly: AssemblyMetadataAttribute("ReleaseDate","2021-03-26T00:00:00.0000000")>]
[<assembly: AssemblyFileVersionAttribute("3.23.0")>]
[<assembly: AssemblyInformationalVersionAttribute("3.23.0")>]
[<assembly: AssemblyMetadataAttribute("ReleaseChannel","release")>]
[<assembly: AssemblyMetadataAttribute("GitHash","959f00c74c33e6cb5064595bf6107bcb11b215b3")>]
[<assembly: AssemblyMetadataAttribute("GitHash","bc8bff18abbd6b4cfd14b67738c9ec22a5412c90")>]
do ()

module internal AssemblyVersionInformation =
let [<Literal>] AssemblyTitle = "NpgsqlFSharpAnalyzer"
let [<Literal>] AssemblyProduct = "NpgsqlFSharpAnalyzer"
let [<Literal>] AssemblyVersion = "3.22.1"
let [<Literal>] AssemblyMetadata_ReleaseDate = "2021-02-09T00:00:00.0000000"
let [<Literal>] AssemblyFileVersion = "3.22.1"
let [<Literal>] AssemblyInformationalVersion = "3.22.1"
let [<Literal>] AssemblyVersion = "3.23.0"
let [<Literal>] AssemblyMetadata_ReleaseDate = "2021-03-26T00:00:00.0000000"
let [<Literal>] AssemblyFileVersion = "3.23.0"
let [<Literal>] AssemblyInformationalVersion = "3.23.0"
let [<Literal>] AssemblyMetadata_ReleaseChannel = "release"
let [<Literal>] AssemblyMetadata_GitHash = "959f00c74c33e6cb5064595bf6107bcb11b215b3"
let [<Literal>] AssemblyMetadata_GitHash = "bc8bff18abbd6b4cfd14b67738c9ec22a5412c90"
20 changes: 10 additions & 10 deletions src/NpgsqlFSharpParser/AssemblyInfo.fs
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ open System.Reflection

[<assembly: AssemblyTitleAttribute("NpgsqlFSharpParser")>]
[<assembly: AssemblyProductAttribute("NpgsqlFSharpAnalyzer")>]
[<assembly: AssemblyVersionAttribute("3.22.1")>]
[<assembly: AssemblyMetadataAttribute("ReleaseDate","2021-02-09T00:00:00.0000000")>]
[<assembly: AssemblyFileVersionAttribute("3.22.1")>]
[<assembly: AssemblyInformationalVersionAttribute("3.22.1")>]
[<assembly: AssemblyVersionAttribute("3.23.0")>]
[<assembly: AssemblyMetadataAttribute("ReleaseDate","2021-03-26T00:00:00.0000000")>]
[<assembly: AssemblyFileVersionAttribute("3.23.0")>]
[<assembly: AssemblyInformationalVersionAttribute("3.23.0")>]
[<assembly: AssemblyMetadataAttribute("ReleaseChannel","release")>]
[<assembly: AssemblyMetadataAttribute("GitHash","959f00c74c33e6cb5064595bf6107bcb11b215b3")>]
[<assembly: AssemblyMetadataAttribute("GitHash","bc8bff18abbd6b4cfd14b67738c9ec22a5412c90")>]
do ()

module internal AssemblyVersionInformation =
let [<Literal>] AssemblyTitle = "NpgsqlFSharpParser"
let [<Literal>] AssemblyProduct = "NpgsqlFSharpAnalyzer"
let [<Literal>] AssemblyVersion = "3.22.1"
let [<Literal>] AssemblyMetadata_ReleaseDate = "2021-02-09T00:00:00.0000000"
let [<Literal>] AssemblyFileVersion = "3.22.1"
let [<Literal>] AssemblyInformationalVersion = "3.22.1"
let [<Literal>] AssemblyVersion = "3.23.0"
let [<Literal>] AssemblyMetadata_ReleaseDate = "2021-03-26T00:00:00.0000000"
let [<Literal>] AssemblyFileVersion = "3.23.0"
let [<Literal>] AssemblyInformationalVersion = "3.23.0"
let [<Literal>] AssemblyMetadata_ReleaseChannel = "release"
let [<Literal>] AssemblyMetadata_GitHash = "959f00c74c33e6cb5064595bf6107bcb11b215b3"
let [<Literal>] AssemblyMetadata_GitHash = "bc8bff18abbd6b4cfd14b67738c9ec22a5412c90"
2 changes: 1 addition & 1 deletion src/NpgsqlFSharpVs/source.extension.vsixmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011"
xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
<Metadata>
<Identity Id="FSharpLintVs.ef00bfc3-a899-45fc-aae8-afecf8673aaf" Version="3.22.1" Language="en-US" Publisher="Zaid Ajaj" />
<Identity Id="FSharpLintVs.ef00bfc3-a899-45fc-aae8-afecf8673aaf" Version="3.23.0" Language="en-US" Publisher="Zaid Ajaj" />
<DisplayName>NpgsqlFSharpVs</DisplayName>
<Description xml:space="preserve">F# Analyzer for embedded SQL syntax analysis, type-checking for parameters and result sets and nullable column detection when writing queries using Npgsql.FSharp.</Description>
<MoreInfo>https://github.com/Zaid-Ajaj/Npgsql.FSharp.Analyzer</MoreInfo>
Expand Down
20 changes: 10 additions & 10 deletions src/Ubik/AssemblyInfo.fs
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ open System.Reflection

[<assembly: AssemblyTitleAttribute("Ubik")>]
[<assembly: AssemblyProductAttribute("NpgsqlFSharpAnalyzer")>]
[<assembly: AssemblyVersionAttribute("3.22.1")>]
[<assembly: AssemblyMetadataAttribute("ReleaseDate","2021-02-09T00:00:00.0000000")>]
[<assembly: AssemblyFileVersionAttribute("3.22.1")>]
[<assembly: AssemblyInformationalVersionAttribute("3.22.1")>]
[<assembly: AssemblyVersionAttribute("3.23.0")>]
[<assembly: AssemblyMetadataAttribute("ReleaseDate","2021-03-26T00:00:00.0000000")>]
[<assembly: AssemblyFileVersionAttribute("3.23.0")>]
[<assembly: AssemblyInformationalVersionAttribute("3.23.0")>]
[<assembly: AssemblyMetadataAttribute("ReleaseChannel","release")>]
[<assembly: AssemblyMetadataAttribute("GitHash","959f00c74c33e6cb5064595bf6107bcb11b215b3")>]
[<assembly: AssemblyMetadataAttribute("GitHash","bc8bff18abbd6b4cfd14b67738c9ec22a5412c90")>]
do ()

module internal AssemblyVersionInformation =
let [<Literal>] AssemblyTitle = "Ubik"
let [<Literal>] AssemblyProduct = "NpgsqlFSharpAnalyzer"
let [<Literal>] AssemblyVersion = "3.22.1"
let [<Literal>] AssemblyMetadata_ReleaseDate = "2021-02-09T00:00:00.0000000"
let [<Literal>] AssemblyFileVersion = "3.22.1"
let [<Literal>] AssemblyInformationalVersion = "3.22.1"
let [<Literal>] AssemblyVersion = "3.23.0"
let [<Literal>] AssemblyMetadata_ReleaseDate = "2021-03-26T00:00:00.0000000"
let [<Literal>] AssemblyFileVersion = "3.23.0"
let [<Literal>] AssemblyInformationalVersion = "3.23.0"
let [<Literal>] AssemblyMetadata_ReleaseChannel = "release"
let [<Literal>] AssemblyMetadata_GitHash = "959f00c74c33e6cb5064595bf6107bcb11b215b3"
let [<Literal>] AssemblyMetadata_GitHash = "bc8bff18abbd6b4cfd14b67738c9ec22a5412c90"
4 changes: 2 additions & 2 deletions src/Ubik/Ubik.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<PackAsTool>true</PackAsTool>
<IsPackable>true</IsPackable>
<RollForward>Major</RollForward>
<Version>3.22.1</Version>
<PackageReleaseNotes>Let the analyzer continue its work when it comes across enum types</PackageReleaseNotes>
<Version>3.23.0</Version>
<PackageReleaseNotes>Detect typed let bindings</PackageReleaseNotes>
</PropertyGroup>

<ItemGroup>
Expand Down
20 changes: 10 additions & 10 deletions tests/NpgsqlFSharpAnalyzer.Tests/AssemblyInfo.fs
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ open System.Reflection

[<assembly: AssemblyTitleAttribute("NpgsqlFSharpAnalyzer.Tests")>]
[<assembly: AssemblyProductAttribute("NpgsqlFSharpAnalyzer")>]
[<assembly: AssemblyVersionAttribute("3.22.1")>]
[<assembly: AssemblyMetadataAttribute("ReleaseDate","2021-02-09T00:00:00.0000000")>]
[<assembly: AssemblyFileVersionAttribute("3.22.1")>]
[<assembly: AssemblyInformationalVersionAttribute("3.22.1")>]
[<assembly: AssemblyVersionAttribute("3.23.0")>]
[<assembly: AssemblyMetadataAttribute("ReleaseDate","2021-03-26T00:00:00.0000000")>]
[<assembly: AssemblyFileVersionAttribute("3.23.0")>]
[<assembly: AssemblyInformationalVersionAttribute("3.23.0")>]
[<assembly: AssemblyMetadataAttribute("ReleaseChannel","release")>]
[<assembly: AssemblyMetadataAttribute("GitHash","959f00c74c33e6cb5064595bf6107bcb11b215b3")>]
[<assembly: AssemblyMetadataAttribute("GitHash","bc8bff18abbd6b4cfd14b67738c9ec22a5412c90")>]
do ()

module internal AssemblyVersionInformation =
let [<Literal>] AssemblyTitle = "NpgsqlFSharpAnalyzer.Tests"
let [<Literal>] AssemblyProduct = "NpgsqlFSharpAnalyzer"
let [<Literal>] AssemblyVersion = "3.22.1"
let [<Literal>] AssemblyMetadata_ReleaseDate = "2021-02-09T00:00:00.0000000"
let [<Literal>] AssemblyFileVersion = "3.22.1"
let [<Literal>] AssemblyInformationalVersion = "3.22.1"
let [<Literal>] AssemblyVersion = "3.23.0"
let [<Literal>] AssemblyMetadata_ReleaseDate = "2021-03-26T00:00:00.0000000"
let [<Literal>] AssemblyFileVersion = "3.23.0"
let [<Literal>] AssemblyInformationalVersion = "3.23.0"
let [<Literal>] AssemblyMetadata_ReleaseChannel = "release"
let [<Literal>] AssemblyMetadata_GitHash = "959f00c74c33e6cb5064595bf6107bcb11b215b3"
let [<Literal>] AssemblyMetadata_GitHash = "bc8bff18abbd6b4cfd14b67738c9ec22a5412c90"
2 changes: 1 addition & 1 deletion tests/NpgsqlFSharpAnalyzer.Tests/Tests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ let tests =
| None -> failwith "Could not crack project"
| Some context ->
let operationBlocks = SyntacticAnalysis.findSqlOperations context
Expect.equal 11 (List.length operationBlocks) "Found 11 operation blocks"
Expect.equal (List.length operationBlocks) 12 "Found 12 operation blocks"
}

test "Syntactic analysis: no SQL blocks should be found using sprintf" {
Expand Down
20 changes: 10 additions & 10 deletions tests/examples/hashing/AssemblyInfo.fs
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ open System.Reflection

[<assembly: AssemblyTitleAttribute("examples")>]
[<assembly: AssemblyProductAttribute("NpgsqlFSharpAnalyzer")>]
[<assembly: AssemblyVersionAttribute("3.22.1")>]
[<assembly: AssemblyMetadataAttribute("ReleaseDate","2021-02-09T00:00:00.0000000")>]
[<assembly: AssemblyFileVersionAttribute("3.22.1")>]
[<assembly: AssemblyInformationalVersionAttribute("3.22.1")>]
[<assembly: AssemblyVersionAttribute("3.23.0")>]
[<assembly: AssemblyMetadataAttribute("ReleaseDate","2021-03-26T00:00:00.0000000")>]
[<assembly: AssemblyFileVersionAttribute("3.23.0")>]
[<assembly: AssemblyInformationalVersionAttribute("3.23.0")>]
[<assembly: AssemblyMetadataAttribute("ReleaseChannel","release")>]
[<assembly: AssemblyMetadataAttribute("GitHash","959f00c74c33e6cb5064595bf6107bcb11b215b3")>]
[<assembly: AssemblyMetadataAttribute("GitHash","bc8bff18abbd6b4cfd14b67738c9ec22a5412c90")>]
do ()

module internal AssemblyVersionInformation =
let [<Literal>] AssemblyTitle = "examples"
let [<Literal>] AssemblyProduct = "NpgsqlFSharpAnalyzer"
let [<Literal>] AssemblyVersion = "3.22.1"
let [<Literal>] AssemblyMetadata_ReleaseDate = "2021-02-09T00:00:00.0000000"
let [<Literal>] AssemblyFileVersion = "3.22.1"
let [<Literal>] AssemblyInformationalVersion = "3.22.1"
let [<Literal>] AssemblyVersion = "3.23.0"
let [<Literal>] AssemblyMetadata_ReleaseDate = "2021-03-26T00:00:00.0000000"
let [<Literal>] AssemblyFileVersion = "3.23.0"
let [<Literal>] AssemblyInformationalVersion = "3.23.0"
let [<Literal>] AssemblyMetadata_ReleaseChannel = "release"
let [<Literal>] AssemblyMetadata_GitHash = "959f00c74c33e6cb5064595bf6107bcb11b215b3"
let [<Literal>] AssemblyMetadata_GitHash = "bc8bff18abbd6b4cfd14b67738c9ec22a5412c90"
6 changes: 6 additions & 0 deletions tests/examples/hashing/syntacticAnalysis.fs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@ module InsidePostgres =
|> Sql.query "SELECT COUNT(*) as count FROM users"
|> Sql.execute (fun read -> read.int64 "count")

let nextedDeclaretionWithExplicitReturnType() : Result<int64 list, exn>=
Sql.host "localhost"
|> Sql.connectFromConfig
|> Sql.query "SELECT COUNT(*) as count FROM users"
|> Sql.execute (fun read -> read.int64 "count")

type NestedWhatever() =
member this.Hello =
let whateverSql() =
Expand Down

0 comments on commit 025b5de

Please sign in to comment.