Skip to content

Commit

Permalink
Split tests (#54)
Browse files Browse the repository at this point in the history
* tidy up test framework

* DAP005tests

* getting into the testing swing
  • Loading branch information
mgravell authored Sep 16, 2023
1 parent d1907d6 commit 3349d60
Show file tree
Hide file tree
Showing 25 changed files with 377 additions and 348 deletions.
4 changes: 2 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[*.cs]

# DAP000: Interceptors generated
dotnet_diagnostic.DAP000.severity = suggestion
# RS2008: Enable analyzer release tracking
dotnet_diagnostic.RS2008.severity = none
1 change: 1 addition & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<DefaultLanguage>en-US</DefaultLanguage>
<IncludeSymbols>false</IncludeSymbols>
<AnalysisMode>latest-Recommended</AnalysisMode>
<Features>($Features);strict</Features>
</PropertyGroup>
<ItemGroup>
<None Include="$(MSBuildThisFileDirectory)Dapper.png" Visible="false">
Expand Down
3 changes: 3 additions & 0 deletions docs/docs.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@
<IsPackable>false</IsPackable>
<GenerateDocumentationFile>false</GenerateDocumentationFile>
</PropertyGroup>
<ItemGroup>
<None Include="..\.editorconfig" Link=".editorconfig" />
</ItemGroup>
</Project>
12 changes: 12 additions & 0 deletions docs/rules/DAP003.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# DAP003

Interceptors are a new feature, and require some project configuration.

The exact shape of this has changed repeatedly, so this guidance is not complete yet.

Things that might be involved, depending on what preview build SDK you're using:

- `<Features>($Features);InterceptorsPreview</Features>`
- `<InterceptorsPreviewNamespaces>$(InterceptorsPreviewNamespaces);Dapper.AOT<InterceptorsPreviewNamespaces>`

This will be clarified for release.
10 changes: 10 additions & 0 deletions docs/rules/DAP004.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# DAP004

Dapper.AOT runs on interceptors, which requires at least C# 11. The language version is implied by
your target .NET version, but can be changed manually - it is fine to use a different language
version than the default for that target runtime, especially when going "higher". For example, you
can use C# 12 on a project that targets .NET Framework (as long as you have up-to-date build tools).

The easiest way to do this is via `<LangVersion>latest</LangVersion>`.

For more information, see https://learn.microsoft.com/dotnet/csharp/language-reference/configure-language-version
22 changes: 22 additions & 0 deletions docs/rules/DAP005.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# DAP005

You're seeing this message because Dapper.AOT has found at least one place where it *could* help, and it
isn't explicit whether you want it to do so.

Dapper.AOT doesn't change any behaviours without your permission. You can *enable* (or disable) Dapper.AOT
at any level by adding a `[DapperAot]` (or `[DapperAot(false)]`) attribute.

To enable Dapper.AOT globally, add (usually to `AssemblyInfo.cs`, although it doesn't matter where):


``` csharp
[module: DapperAot]
```

Alternatively, if you only want it in a few places, use:

``` csharp
[module: DapperAot(false)]
```

and add `[DapperAot]` at more specific levels - types, individual methods, etc.
72 changes: 0 additions & 72 deletions src/Dapper.AOT.Analyzers/AnalyzerReleases.Shipped.md

This file was deleted.

7 changes: 0 additions & 7 deletions src/Dapper.AOT.Analyzers/AnalyzerReleases.Unshipped.md

This file was deleted.

Loading

0 comments on commit 3349d60

Please sign in to comment.