forked from meziantou/Meziantou.Analyzer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Meziantou.Analyzer.Annotations package (meziantou#579)
- Loading branch information
Showing
9 changed files
with
69 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#pragma warning disable CS1591 | ||
#pragma warning disable IDE0060 | ||
#pragma warning disable IDE0290 | ||
#pragma warning disable CA1019 | ||
#nullable disable | ||
|
||
namespace Meziantou.Analyzer.Annotations | ||
{ | ||
/// <summary> | ||
/// Indicates arguments must be named for this parameter. | ||
/// </summary> | ||
[System.Diagnostics.Conditional("MEZIANTOU_ANALYZER_ANNOTATIONS")] | ||
[System.AttributeUsage(System.AttributeTargets.Parameter)] | ||
public sealed class RequireNamedArgumentAttribute : System.Attribute | ||
{ | ||
public RequireNamedArgumentAttribute() { } | ||
|
||
public RequireNamedArgumentAttribute(bool isRequired) { } | ||
} | ||
|
||
[System.Diagnostics.Conditional("MEZIANTOU_ANALYZER_ANNOTATIONS")] | ||
[System.AttributeUsage(System.AttributeTargets.Assembly, AllowMultiple = true, Inherited = false)] | ||
public sealed class StructuredLogFieldAttribute : System.Attribute | ||
{ | ||
public StructuredLogFieldAttribute(string parameterName, params System.Type[] allowedTypes) { } | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
src/Meziantou.Analyzer.Annotations/Meziantou.Analyzer.Annotations.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFrameworks>netstandard1.0;netstandard2.0</TargetFrameworks> | ||
<Version>1.0.0</Version> | ||
<AssemblyVersion>1.0.0</AssemblyVersion> | ||
<Description>Annotations to configure Meziantou.Analyzer</Description> | ||
<PackageTags>Meziantou.Analyzer, analyzers</PackageTags> | ||
<GenerateDocumentationFile>True</GenerateDocumentationFile> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<None Include="README.md" Pack="true" PackagePath="" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Remove="Meziantou.Polyfill" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Meziantou.Analyzer.Annotations help configuring some rules by annotating your code. | ||
|
||
All usages of Meziantou.Analyzer.Annotations attributes are erased from metadata by default, which means no actual binary reference to 'Meziantou.Analyzer.Annotations.dll' assembly is produced. If you need to preserve these attributes in metadata, just define 'MEZIANTOU_ANALYZER_ANNOTATIONS' conditional compilation symbol in your projects. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters