• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

loresoft / FluentCommand / 26620856256

29 May 2026 05:53AM UTC coverage: 54.913% (-0.9%) from 55.778%
26620856256

push

github

pwelter34
Validate JsonColumn and use fully-qualified types

1412 of 3414 branches covered (41.36%)

Branch coverage included in aggregate %.

13 of 102 new or added lines in 4 files covered. (12.75%)

12 existing lines in 3 files now uncovered.

4478 of 7312 relevant lines covered (61.24%)

306.51 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/FluentCommand.Generators/DiagnosticDescriptors.cs
1
using Microsoft.CodeAnalysis;
2

3
namespace FluentCommand.Generators;
4

5
/// <summary>
6
/// Centralized diagnostic descriptors for the DataReaderFactory source generator and analyzer.
7
/// </summary>
8
internal static class DiagnosticDescriptors
9
{
10
    private const string Category = "Usage";
11

12
    /// <summary>
13
    /// FLC001: Type has no parameterless constructor and no constructor matching mappable property count.
14
    /// </summary>
15
    public static readonly DiagnosticDescriptor NoMatchingConstructor = new(
×
16
        id: "FLC001",
×
17
        title: "No matching constructor found",
×
18
        messageFormat: "Type '{0}' has no parameterless constructor and no constructor with {1} parameters matching the mappable property count",
×
19
        category: Category,
×
20
        defaultSeverity: DiagnosticSeverity.Error,
×
21
        isEnabledByDefault: true,
×
22
        description: "The source generator requires either a parameterless constructor (for object initializer mode) or a constructor whose parameter count matches the number of mappable properties."
×
23
    );
×
24

25
    /// <summary>
26
    /// FLC002: Constructor parameter does not match any property.
27
    /// </summary>
28
    public static readonly DiagnosticDescriptor ConstructorParameterNotMatched = new(
×
29
        id: "FLC002",
×
30
        title: "Constructor parameter has no matching property",
×
31
        messageFormat: "Constructor parameter '{0}' on type '{1}' does not match any public property (case-insensitive)",
×
32
        category: Category,
×
33
        defaultSeverity: DiagnosticSeverity.Warning,
×
34
        isEnabledByDefault: true,
×
35
        description: "When using constructor initialization, every constructor parameter must match a public property name (case-insensitive)."
×
36
    );
×
37

38
    /// <summary>
39
    /// FLC003: Type has no mappable properties.
40
    /// </summary>
41
    public static readonly DiagnosticDescriptor NoMappableProperties = new(
×
42
        id: "FLC003",
×
43
        title: "No mappable properties found",
×
44
        messageFormat: "Type '{0}' has no mappable properties; the generated reader will not map any columns",
×
45
        category: Category,
×
46
        defaultSeverity: DiagnosticSeverity.Warning,
×
47
        isEnabledByDefault: true,
×
48
        description: "All public properties are either ignored, not-mapped, or have unsupported types. The generated data reader extension will produce an empty mapping."
×
49
    );
×
50

51
    /// <summary>
52
    /// FLC004: Property type is not supported for data reader mapping.
53
    /// </summary>
54
    public static readonly DiagnosticDescriptor UnsupportedPropertyType = new(
×
55
        id: "FLC004",
×
56
        title: "Unsupported property type",
×
57
        messageFormat: "Property '{0}' on type '{1}' has unsupported type '{2}' and will not be mapped",
×
58
        category: Category,
×
59
        defaultSeverity: DiagnosticSeverity.Info,
×
60
        isEnabledByDefault: true,
×
61
        description: "The property type is not a supported primitive, enum, or known struct type. The property will be excluded from data reader mapping."
×
62
    );
×
63

64
    /// <summary>
65
    /// FLC005: [GenerateReader] attribute has an invalid type argument.
66
    /// </summary>
67
    public static readonly DiagnosticDescriptor InvalidGenerateReaderArgument = new(
×
68
        id: "FLC005",
×
69
        title: "Invalid GenerateReader type argument",
×
70
        messageFormat: "The [GenerateReader] attribute on '{0}' has an invalid or missing type argument",
×
71
        category: Category,
×
72
        defaultSeverity: DiagnosticSeverity.Error,
×
73
        isEnabledByDefault: true,
×
74
        description: "The [GenerateReader(typeof(T))] attribute requires exactly one type argument that resolves to a named type."
×
75
    );
×
76

77
    /// <summary>
78
    /// FLC006: [Table] attribute applied to a static or abstract type.
79
    /// </summary>
80
    public static readonly DiagnosticDescriptor TableAttributeOnInvalidType = new(
×
81
        id: "FLC006",
×
82
        title: "Table attribute on static or abstract type",
×
83
        messageFormat: "The [Table] attribute on '{0}' is ignored because the type is {1}",
×
84
        category: Category,
×
85
        defaultSeverity: DiagnosticSeverity.Warning,
×
86
        isEnabledByDefault: true,
×
87
        description: "The source generator skips static and abstract types annotated with [Table]. Remove the attribute or make the type non-static and non-abstract."
×
88
    );
×
89

90
    /// <summary>
91
    /// FLC007: [JsonColumn] options provider type is invalid.
92
    /// </summary>
NEW
93
    public static readonly DiagnosticDescriptor InvalidJsonColumnOptionsProvider = new(
×
NEW
94
        id: "FLC007",
×
NEW
95
        title: "Invalid JsonColumn options provider",
×
NEW
96
        messageFormat: "The [JsonColumn] options provider type '{0}' must expose a static Options property of type System.Text.Json.JsonSerializerOptions",
×
NEW
97
        category: Category,
×
NEW
98
        defaultSeverity: DiagnosticSeverity.Error,
×
NEW
99
        isEnabledByDefault: true,
×
NEW
100
        description: "The [JsonColumn(typeof(TProvider))] attribute requires a provider type with a static Options property compatible with System.Text.Json.JsonSerializerOptions."
×
NEW
101
    );
×
102

103
    /// <summary>
104
    /// FLC008: [JsonColumn] serializer context type or property is invalid.
105
    /// </summary>
NEW
106
    public static readonly DiagnosticDescriptor InvalidJsonColumnSerializerContext = new(
×
NEW
107
        id: "FLC008",
×
NEW
108
        title: "Invalid JsonColumn serializer context",
×
NEW
109
        messageFormat: "The [JsonColumn] serializer context type '{0}' must derive from System.Text.Json.Serialization.JsonSerializerContext and expose a property named '{1}'",
×
NEW
110
        category: Category,
×
NEW
111
        defaultSeverity: DiagnosticSeverity.Error,
×
NEW
112
        isEnabledByDefault: true,
×
NEW
113
        description: "The [JsonColumn(typeof(TContext), name)] attribute requires a serializer context type and a named type-info property that exists on the context."
×
NEW
114
    );
×
115
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc