Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix warnings for analyzer release #227

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions DllImportGenerator/DllImportGenerator/AnalyzerReleases.Shipped.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
## Release 1.0

### New Rules

Rule ID | Category | Severity | Notes
--------|----------|----------|-------
DLLIMPORTGEN001 | Usage | Error
DLLIMPORTGEN002 | Usage | Error
DLLIMPORTGENANALYZER001 | Usage | Error
DLLIMPORTGENANALYZER002 | Usage | Error
DLLIMPORTGENANALYZER003 | Usage | Error
DLLIMPORTGENANALYZER004 | Usage | Error
DLLIMPORTGENANALYZER005 | Usage | Error
DLLIMPORTGENANALYZER006 | Usage | Error
DLLIMPORTGENANALYZER007 | Usage | Error
DLLIMPORTGENANALYZER008 | Usage | Error
DLLIMPORTGENANALYZER009 | Usage | Error
DLLIMPORTGENANALYZER010 | Usage | Warning
DLLIMPORTGENANALYZER011 | Usage | Warning
DLLIMPORTGENANALYZER012 | Usage | Error
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public class Ids
public const string ConfigurationNotSupported = Prefix + "002";
}

private const string Category = "DllImportGenerator";
private const string Category = "SourceGeneration";

public readonly static DiagnosticDescriptor ParameterTypeNotSupported =
new DiagnosticDescriptor(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ namespace Microsoft.Interop
[DiagnosticAnalyzer(LanguageNames.CSharp)]
public class ManualTypeMarshallingAnalyzer : DiagnosticAnalyzer
{
public const string Prefix = "DLLIMPORTGENANALYZER";
private const string Category = "Usage";
public readonly static DiagnosticDescriptor BlittableTypeMustBeBlittableRule =
new DiagnosticDescriptor(
"INTEROPGEN001",
Prefix + "001",
"BlittableTypeMustBeBlittable",
new LocalizableResourceString(nameof(Resources.BlittableTypeMustBeBlittableMessage), Resources.ResourceManager, typeof(Resources)),
Category,
Expand All @@ -25,7 +26,7 @@ public class ManualTypeMarshallingAnalyzer : DiagnosticAnalyzer

public readonly static DiagnosticDescriptor CannotHaveMultipleMarshallingAttributesRule =
new DiagnosticDescriptor(
"INTEROPGEN002",
Prefix + "002",
"CannotHaveMultipleMarshallingAttributes",
new LocalizableResourceString(nameof(Resources.CannotHaveMultipleMarshallingAttributesMessage), Resources.ResourceManager, typeof(Resources)),
Category,
Expand All @@ -36,7 +37,7 @@ public class ManualTypeMarshallingAnalyzer : DiagnosticAnalyzer

public readonly static DiagnosticDescriptor NativeTypeMustBeNonNullRule =
new DiagnosticDescriptor(
"INTEROPGEN003",
Prefix + "003",
"NativeTypeMustBeNonNull",
new LocalizableResourceString(nameof(Resources.NativeTypeMustBeNonNullMessage), Resources.ResourceManager, typeof(Resources)),
Category,
Expand All @@ -46,7 +47,7 @@ public class ManualTypeMarshallingAnalyzer : DiagnosticAnalyzer

public readonly static DiagnosticDescriptor NativeTypeMustBeBlittableRule =
new DiagnosticDescriptor(
"INTEROPGEN004",
Prefix + "004",
"NativeTypeMustBeBlittable",
new LocalizableResourceString(nameof(Resources.NativeTypeMustBeBlittableMessage), Resources.ResourceManager, typeof(Resources)),
Category,
Expand All @@ -56,7 +57,7 @@ public class ManualTypeMarshallingAnalyzer : DiagnosticAnalyzer

public readonly static DiagnosticDescriptor GetPinnableReferenceReturnTypeBlittableRule =
new DiagnosticDescriptor(
"INTEROPGEN005",
Prefix + "005",
"GetPinnableReferenceReturnTypeBlittable",
new LocalizableResourceString(nameof(Resources.GetPinnableReferenceReturnTypeBlittableMessage), Resources.ResourceManager, typeof(Resources)),
Category,
Expand All @@ -66,7 +67,7 @@ public class ManualTypeMarshallingAnalyzer : DiagnosticAnalyzer

public readonly static DiagnosticDescriptor NativeTypeMustBePointerSizedRule =
new DiagnosticDescriptor(
"INTEROPGEN006",
Prefix + "006",
"NativeTypeMustBePointerSized",
new LocalizableResourceString(nameof(Resources.NativeTypeMustBePointerSizedMessage), Resources.ResourceManager, typeof(Resources)),
Category,
Expand All @@ -76,7 +77,7 @@ public class ManualTypeMarshallingAnalyzer : DiagnosticAnalyzer

public readonly static DiagnosticDescriptor NativeTypeMustHaveRequiredShapeRule =
new DiagnosticDescriptor(
"INTEROPGEN007",
Prefix + "007",
"NativeTypeMustHaveRequiredShape",
new LocalizableResourceString(nameof(Resources.NativeTypeMustHaveRequiredShapeMessage), Resources.ResourceManager, typeof(Resources)),
Category,
Expand All @@ -86,7 +87,7 @@ public class ManualTypeMarshallingAnalyzer : DiagnosticAnalyzer

public readonly static DiagnosticDescriptor ValuePropertyMustHaveSetterRule =
new DiagnosticDescriptor(
"INTEROPGEN008",
Prefix + "008",
"ValuePropertyMustHaveSetter",
new LocalizableResourceString(nameof(Resources.ValuePropertyMustHaveSetterMessage), Resources.ResourceManager, typeof(Resources)),
Category,
Expand All @@ -96,7 +97,7 @@ public class ManualTypeMarshallingAnalyzer : DiagnosticAnalyzer

public readonly static DiagnosticDescriptor ValuePropertyMustHaveGetterRule =
new DiagnosticDescriptor(
"INTEROPGEN009",
Prefix + "009",
"ValuePropertyMustHaveGetter",
new LocalizableResourceString(nameof(Resources.ValuePropertyMustHaveGetterMessage), Resources.ResourceManager, typeof(Resources)),
Category,
Expand All @@ -106,7 +107,7 @@ public class ManualTypeMarshallingAnalyzer : DiagnosticAnalyzer

public readonly static DiagnosticDescriptor GetPinnableReferenceShouldSupportAllocatingMarshallingFallbackRule =
new DiagnosticDescriptor(
"INTEROPGEN010",
Prefix + "010",
"GetPinnableReferenceShouldSupportAllocatingMarshallingFallback",
new LocalizableResourceString(nameof(Resources.GetPinnableReferenceShouldSupportAllocatingMarshallingFallbackMessage), Resources.ResourceManager, typeof(Resources)),
Category,
Expand All @@ -116,7 +117,7 @@ public class ManualTypeMarshallingAnalyzer : DiagnosticAnalyzer

public readonly static DiagnosticDescriptor StackallocMarshallingShouldSupportAllocatingMarshallingFallbackRule =
new DiagnosticDescriptor(
"INTEROPGEN011",
Prefix + "011",
"StackallocMarshallingShouldSupportAllocatingMarshallingFallback",
new LocalizableResourceString(nameof(Resources.StackallocMarshallingShouldSupportAllocatingMarshallingFallbackMessage), Resources.ResourceManager, typeof(Resources)),
Category,
Expand All @@ -126,7 +127,7 @@ public class ManualTypeMarshallingAnalyzer : DiagnosticAnalyzer

public readonly static DiagnosticDescriptor StackallocConstructorMustHaveStackBufferSizeConstantRule =
new DiagnosticDescriptor(
"INTEROPGEN012",
Prefix + "012",
"StackallocConstructorMustHaveStackBufferSizeConstant",
new LocalizableResourceString(nameof(Resources.StackallocConstructorMustHaveStackBufferSizeConstantMessage), Resources.ResourceManager, typeof(Resources)),
Category,
Expand Down