Skip to content

Commit

Permalink
revert DAP000 severity tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
mgravell committed Nov 14, 2023
1 parent 455924e commit 0089c71
Show file tree
Hide file tree
Showing 57 changed files with 71 additions and 61 deletions.
3 changes: 0 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,3 @@ dotnet_diagnostic.RS2008.severity = none

# IDE0290: Use primary constructor
dotnet_diagnostic.IDE0290.severity = none

# show Dapper outputs
dotnet_diagnostic.DAP000.severity = suggestion
8 changes: 4 additions & 4 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<Project>
<!--<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Packages.props, $(MSBuildThisFileDirectory)..))" />..-->
<ItemGroup>
<PackageVersion Include="BenchmarkDotNet" Version="0.13.8" />
<PackageVersion Include="BenchmarkDotNet" Version="0.13.10" />
<PackageVersion Include="FastMember" Version="1.5.0" />
<PackageVersion Include="Dapper" Version="2.1.21" />
<PackageVersion Include="Dapper.AOT" Version="0.5.0-beta.129" />
<PackageVersion Include="Dapper.AOT" Version="0.5.0-beta.137" />
<PackageVersion Include="Dapper.StrongName" Version="2.1.21" />
<PackageVersion Include="System.Memory" Version="4.5.5" />
<PackageVersion Include="Nerdbank.GitVersioning" Version="3.6.133" />
Expand All @@ -15,8 +15,8 @@
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="[4.4.0]" />
<PackageVersion Include="Microsoft.CodeAnalysis.VisualBasic.Workspaces" Version="[4.4.0]" />
<PackageVersion Include="Microsoft.Data.SqlClient" Version="5.1.2" />
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="7.0.11" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.11" />
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="7.0.13" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.13" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="1.1.1" />
<PackageVersion Include="Oracle.ManagedDataAccess" Version="21.12.0" />
Expand Down
13 changes: 12 additions & 1 deletion docs/gettingstarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,4 +142,15 @@ Build succeeded.
0 Error(s)
```

That's.. underwhelming, but: a lot is going on under the covers. The fact that you didn't need to change your code is intentional. If we
That's.. underwhelming, but: a lot is going on under the covers. The fact that you didn't need to change your code is intentional. Your data-access code is now
working build build-time support, and should work with AOT deployment.

## Limitations and caveats

`Dapper.AOT` does not support all `Dapper` features; not all APIs are supported, and when an API is supported it might have limitations - for example, the *generic* APIs
like `Query<Foo>` should work, but the *non-generic* API passing `typeof(Foo)` *is not* supported. The underlying implementation is completely separate to `Dapper` (and *usually*
your code doesn't even need `Dapper` once compiled); there may be subtle differences in how some things behave.

**PLEASE TEST YOUR CODE CAREFULLY**

If something looks wrong, missing, or would benefit from more usage guidance [let us know!](https://github.com/DapperLib/DapperAOT/issues/new/choose)
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ internal sealed class Diagnostics : DiagnosticsBase
{

internal static readonly DiagnosticDescriptor
InterceptorsGenerated = LibraryInfo("DAP000", "Interceptors generated", "Dapper.AOT handled {0} of {1} possible call-sites using {2} interceptors, {3} commands and {4} readers"),
InterceptorsGenerated = LibraryHidden("DAP000", "Interceptors generated", "Dapper.AOT handled {0} of {1} possible call-sites using {2} interceptors, {3} commands and {4} readers"),
LanguageVersionTooLow = LibraryWarning("DAP004", "Language version too low", "Interceptors require at least C# version 11"),

CommandPropertyNotFound = LibraryWarning("DAP033", "Command property not found", "Command property {0}.{1} was not found or was not valid; attribute will be ignored"),
Expand Down
2 changes: 2 additions & 0 deletions src/Dapper.AOT.Analyzers/CodeAnalysis/Diagnostics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ private static DiagnosticDescriptor Create(string id, string title, string messa
new(id, title,
messageFormat, category, severity, true, helpLinkUri: RulesRoot + id);

protected static DiagnosticDescriptor LibraryHidden(string id, string title, string messageFormat) => Create(id, title, messageFormat, Category.Library, DiagnosticSeverity.Hidden);

protected static DiagnosticDescriptor LibraryWarning(string id, string title, string messageFormat) => Create(id, title, messageFormat, Category.Library, DiagnosticSeverity.Warning);

protected static DiagnosticDescriptor LibraryError(string id, string title, string messageFormat) => Create(id, title, messageFormat, Category.Library, DiagnosticSeverity.Error);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Generator produced 1 diagnostics:

Info DAP000 L1 C1
Hidden DAP000 L1 C1
Dapper.AOT handled 1 of 1 possible call-sites using 1 interceptors, 1 commands and 0 readers
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Generator produced 1 diagnostics:

Info DAP000 L1 C1
Hidden DAP000 L1 C1
Dapper.AOT handled 1 of 1 possible call-sites using 1 interceptors, 1 commands and 0 readers
2 changes: 1 addition & 1 deletion test/Dapper.AOT.Test/Interceptors/Blame.output.netfx.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Generator produced 1 diagnostics:

Info DAP000 L1 C1
Hidden DAP000 L1 C1
Dapper.AOT handled 23 of 23 possible call-sites using 1 interceptors, 0 commands and 0 readers
2 changes: 1 addition & 1 deletion test/Dapper.AOT.Test/Interceptors/Blame.output.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Generator produced 1 diagnostics:

Info DAP000 L1 C1
Hidden DAP000 L1 C1
Dapper.AOT handled 23 of 23 possible call-sites using 1 interceptors, 0 commands and 0 readers
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Generator produced 1 diagnostics:

Info DAP000 L1 C1
Hidden DAP000 L1 C1
Dapper.AOT handled 4 of 4 possible call-sites using 4 interceptors, 6 commands and 0 readers
2 changes: 1 addition & 1 deletion test/Dapper.AOT.Test/Interceptors/CacheCommand.output.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Generator produced 1 diagnostics:

Info DAP000 L1 C1
Hidden DAP000 L1 C1
Dapper.AOT handled 4 of 4 possible call-sites using 4 interceptors, 6 commands and 0 readers
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Generator produced 3 diagnostics:

Info DAP000 L1 C1
Hidden DAP000 L1 C1
Dapper.AOT handled 6 of 6 possible call-sites using 5 interceptors, 7 commands and 1 readers

Warning DAP033 Interceptors/CommandProperties.input.cs L12 C17
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Generator produced 3 diagnostics:

Info DAP000 L1 C1
Hidden DAP000 L1 C1
Dapper.AOT handled 6 of 6 possible call-sites using 5 interceptors, 7 commands and 1 readers

Warning DAP033 Interceptors/CommandProperties.input.cs L12 C17
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Generator produced 1 diagnostics:

Info DAP000 L1 C1
Hidden DAP000 L1 C1
Dapper.AOT handled 6 of 6 possible call-sites using 1 interceptors, 0 commands and 0 readers
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Generator produced 1 diagnostics:

Info DAP000 L1 C1
Hidden DAP000 L1 C1
Dapper.AOT handled 6 of 6 possible call-sites using 1 interceptors, 0 commands and 0 readers
2 changes: 1 addition & 1 deletion test/Dapper.AOT.Test/Interceptors/Execute.output.netfx.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Generator produced 1 diagnostics:

Info DAP000 L1 C1
Hidden DAP000 L1 C1
Dapper.AOT handled 6 of 6 possible call-sites using 6 interceptors, 1 commands and 0 readers
2 changes: 1 addition & 1 deletion test/Dapper.AOT.Test/Interceptors/Execute.output.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Generator produced 1 diagnostics:

Info DAP000 L1 C1
Hidden DAP000 L1 C1
Dapper.AOT handled 6 of 6 possible call-sites using 6 interceptors, 1 commands and 0 readers
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Generator produced 1 diagnostics:

Info DAP000 L1 C1
Hidden DAP000 L1 C1
Dapper.AOT handled 9 of 9 possible call-sites using 9 interceptors, 3 commands and 0 readers
2 changes: 1 addition & 1 deletion test/Dapper.AOT.Test/Interceptors/ExecuteBatch.output.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Generator produced 1 diagnostics:

Info DAP000 L1 C1
Hidden DAP000 L1 C1
Dapper.AOT handled 9 of 9 possible call-sites using 9 interceptors, 3 commands and 0 readers
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Generator produced 1 diagnostics:

Info DAP000 L1 C1
Hidden DAP000 L1 C1
Dapper.AOT handled 12 of 12 possible call-sites using 12 interceptors, 1 commands and 0 readers
2 changes: 1 addition & 1 deletion test/Dapper.AOT.Test/Interceptors/ExecuteScalar.output.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Generator produced 1 diagnostics:

Info DAP000 L1 C1
Hidden DAP000 L1 C1
Dapper.AOT handled 12 of 12 possible call-sites using 12 interceptors, 1 commands and 0 readers
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Generator produced 1 diagnostics:

Info DAP000 L1 C1
Hidden DAP000 L1 C1
Dapper.AOT handled 2 of 2 possible call-sites using 2 interceptors, 0 commands and 1 readers
2 changes: 1 addition & 1 deletion test/Dapper.AOT.Test/Interceptors/GetRowParser.output.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Generator produced 1 diagnostics:

Info DAP000 L1 C1
Hidden DAP000 L1 C1
Dapper.AOT handled 2 of 2 possible call-sites using 2 interceptors, 0 commands and 1 readers
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Generator produced 1 diagnostics:

Info DAP000 L1 C1
Hidden DAP000 L1 C1
Dapper.AOT handled 1 of 1 possible call-sites using 1 interceptors, 1 commands and 1 readers
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Generator produced 1 diagnostics:

Info DAP000 L1 C1
Hidden DAP000 L1 C1
Dapper.AOT handled 1 of 1 possible call-sites using 1 interceptors, 1 commands and 1 readers
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Generator produced 1 diagnostics:

Info DAP000 L1 C1
Hidden DAP000 L1 C1
Dapper.AOT handled 7 of 7 possible call-sites using 4 interceptors, 4 commands and 0 readers
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Generator produced 1 diagnostics:

Info DAP000 L1 C1
Hidden DAP000 L1 C1
Dapper.AOT handled 7 of 7 possible call-sites using 4 interceptors, 4 commands and 0 readers
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Generator produced 1 diagnostics:

Info DAP000 L1 C1
Hidden DAP000 L1 C1
Dapper.AOT handled 9 of 9 possible call-sites using 8 interceptors, 3 commands and 3 readers
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Generator produced 1 diagnostics:

Info DAP000 L1 C1
Hidden DAP000 L1 C1
Dapper.AOT handled 9 of 9 possible call-sites using 8 interceptors, 3 commands and 3 readers
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Generator produced 1 diagnostics:

Info DAP000 L1 C1
Hidden DAP000 L1 C1
Dapper.AOT handled 2 of 2 possible call-sites using 2 interceptors, 1 commands and 0 readers
2 changes: 1 addition & 1 deletion test/Dapper.AOT.Test/Interceptors/NonConstant.output.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Generator produced 1 diagnostics:

Info DAP000 L1 C1
Hidden DAP000 L1 C1
Dapper.AOT handled 2 of 2 possible call-sites using 2 interceptors, 1 commands and 0 readers
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Generator produced 1 diagnostics:

Info DAP000 L1 C1
Hidden DAP000 L1 C1
Dapper.AOT handled 2 of 2 possible call-sites using 2 interceptors, 1 commands and 1 readers
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Generator produced 1 diagnostics:

Info DAP000 L1 C1
Hidden DAP000 L1 C1
Dapper.AOT handled 2 of 2 possible call-sites using 2 interceptors, 1 commands and 1 readers
2 changes: 1 addition & 1 deletion test/Dapper.AOT.Test/Interceptors/Query.output.netfx.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Generator produced 1 diagnostics:

Info DAP000 L1 C1
Hidden DAP000 L1 C1
Dapper.AOT handled 7 of 7 possible call-sites using 7 interceptors, 2 commands and 1 readers
2 changes: 1 addition & 1 deletion test/Dapper.AOT.Test/Interceptors/Query.output.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Generator produced 1 diagnostics:

Info DAP000 L1 C1
Hidden DAP000 L1 C1
Dapper.AOT handled 9 of 9 possible call-sites using 9 interceptors, 2 commands and 1 readers
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Generator produced 1 diagnostics:

Info DAP000 L1 C1
Hidden DAP000 L1 C1
Dapper.AOT handled 12 of 12 possible call-sites using 12 interceptors, 0 commands and 12 readers
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Generator produced 1 diagnostics:

Info DAP000 L1 C1
Hidden DAP000 L1 C1
Dapper.AOT handled 12 of 12 possible call-sites using 12 interceptors, 0 commands and 12 readers
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Generator produced 1 diagnostics:

Info DAP000 L1 C1
Hidden DAP000 L1 C1
Dapper.AOT handled 4 of 4 possible call-sites using 4 interceptors, 0 commands and 4 readers
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Generator produced 1 diagnostics:

Info DAP000 L1 C1
Hidden DAP000 L1 C1
Dapper.AOT handled 4 of 4 possible call-sites using 4 interceptors, 0 commands and 4 readers
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Generator produced 1 diagnostics:

Info DAP000 L1 C1
Hidden DAP000 L1 C1
Dapper.AOT handled 11 of 11 possible call-sites using 7 interceptors, 1 commands and 1 readers
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Generator produced 1 diagnostics:

Info DAP000 L1 C1
Hidden DAP000 L1 C1
Dapper.AOT handled 11 of 11 possible call-sites using 7 interceptors, 1 commands and 1 readers
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Generator produced 1 diagnostics:

Info DAP000 L1 C1
Hidden DAP000 L1 C1
Dapper.AOT handled 15 of 15 possible call-sites using 15 interceptors, 2 commands and 0 readers
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Generator produced 1 diagnostics:

Info DAP000 L1 C1
Hidden DAP000 L1 C1
Dapper.AOT handled 17 of 17 possible call-sites using 17 interceptors, 2 commands and 0 readers
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Generator produced 1 diagnostics:

Info DAP000 L1 C1
Hidden DAP000 L1 C1
Dapper.AOT handled 18 of 18 possible call-sites using 18 interceptors, 0 commands and 0 readers
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Generator produced 1 diagnostics:

Info DAP000 L1 C1
Hidden DAP000 L1 C1
Dapper.AOT handled 21 of 21 possible call-sites using 21 interceptors, 0 commands and 0 readers
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Generator produced 1 diagnostics:

Info DAP000 L1 C1
Hidden DAP000 L1 C1
Dapper.AOT handled 21 of 21 possible call-sites using 21 interceptors, 2 commands and 0 readers
2 changes: 1 addition & 1 deletion test/Dapper.AOT.Test/Interceptors/QueryUntyped.output.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Generator produced 1 diagnostics:

Info DAP000 L1 C1
Hidden DAP000 L1 C1
Dapper.AOT handled 25 of 25 possible call-sites using 25 interceptors, 2 commands and 0 readers
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Generator produced 1 diagnostics:

Info DAP000 L1 C1
Hidden DAP000 L1 C1
Dapper.AOT handled 3 of 3 possible call-sites using 3 interceptors, 2 commands and 1 readers
2 changes: 1 addition & 1 deletion test/Dapper.AOT.Test/Interceptors/RowCountHint.output.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Generator produced 1 diagnostics:

Info DAP000 L1 C1
Hidden DAP000 L1 C1
Dapper.AOT handled 3 of 3 possible call-sites using 3 interceptors, 2 commands and 1 readers
2 changes: 1 addition & 1 deletion test/Dapper.AOT.Test/Interceptors/Single.output.netfx.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Generator produced 1 diagnostics:

Info DAP000 L1 C1
Hidden DAP000 L1 C1
Dapper.AOT handled 8 of 8 possible call-sites using 8 interceptors, 2 commands and 1 readers
2 changes: 1 addition & 1 deletion test/Dapper.AOT.Test/Interceptors/Single.output.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Generator produced 1 diagnostics:

Info DAP000 L1 C1
Hidden DAP000 L1 C1
Dapper.AOT handled 8 of 8 possible call-sites using 8 interceptors, 2 commands and 1 readers
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Generator produced 1 diagnostics:

Info DAP000 L1 C1
Hidden DAP000 L1 C1
Dapper.AOT handled 7 of 7 possible call-sites using 5 interceptors, 2 commands and 0 readers
Output code has 2 diagnostics from 'Dapper.AOT.Analyzers/Dapper.CodeAnalysis.DapperInterceptorGenerator/Test.generated.cs':

Expand Down
2 changes: 1 addition & 1 deletion test/Dapper.AOT.Test/Interceptors/SqlDetection.output.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Generator produced 1 diagnostics:

Info DAP000 L1 C1
Hidden DAP000 L1 C1
Dapper.AOT handled 7 of 7 possible call-sites using 5 interceptors, 2 commands and 0 readers
Output code has 1 diagnostics from 'Dapper.AOT.Analyzers/Dapper.CodeAnalysis.DapperInterceptorGenerator/Test.generated.cs':

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Generator produced 1 diagnostics:

Info DAP000 L1 C1
Hidden DAP000 L1 C1
Dapper.AOT handled 10 of 10 possible call-sites using 3 interceptors, 2 commands and 0 readers
2 changes: 1 addition & 1 deletion test/Dapper.AOT.Test/Interceptors/SqlParse.output.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Generator produced 1 diagnostics:

Info DAP000 L1 C1
Hidden DAP000 L1 C1
Dapper.AOT handled 10 of 10 possible call-sites using 3 interceptors, 2 commands and 0 readers
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Generator produced 1 diagnostics:

Info DAP000 L1 C1
Hidden DAP000 L1 C1
Dapper.AOT handled 54 of 54 possible call-sites using 10 interceptors, 3 commands and 1 readers
Output code has 1 diagnostics from 'Dapper.AOT.Analyzers/Dapper.CodeAnalysis.DapperInterceptorGenerator/Test.generated.cs':

Expand Down
2 changes: 1 addition & 1 deletion test/Dapper.AOT.Test/Interceptors/TsqlTips.output.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Generator produced 1 diagnostics:

Info DAP000 L1 C1
Hidden DAP000 L1 C1
Dapper.AOT handled 54 of 54 possible call-sites using 10 interceptors, 3 commands and 1 readers

0 comments on commit 0089c71

Please sign in to comment.