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

loresoft / FluentCommand / 24681616811

20 Apr 2026 05:44PM UTC coverage: 54.554%. First build
24681616811

push

github

pwelter34
Add DataReaderFactory analyzer and refactor generator

1418 of 3381 branches covered (41.94%)

Branch coverage included in aggregate %.

55 of 344 new or added lines in 4 files covered. (15.99%)

4344 of 7181 relevant lines covered (60.49%)

317.64 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>
NEW
15
    public static readonly DiagnosticDescriptor NoMatchingConstructor = new(
×
NEW
16
        id: "FLC001",
×
NEW
17
        title: "No matching constructor found",
×
NEW
18
        messageFormat: "Type '{0}' has no parameterless constructor and no constructor with {1} parameters matching the mappable property count",
×
NEW
19
        category: Category,
×
NEW
20
        defaultSeverity: DiagnosticSeverity.Error,
×
NEW
21
        isEnabledByDefault: true,
×
NEW
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."
×
NEW
23
    );
×
24

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

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

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

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

77
    /// <summary>
78
    /// FLC006: [Table] attribute applied to a static or abstract type.
79
    /// </summary>
NEW
80
    public static readonly DiagnosticDescriptor TableAttributeOnInvalidType = new(
×
NEW
81
        id: "FLC006",
×
NEW
82
        title: "Table attribute on static or abstract type",
×
NEW
83
        messageFormat: "The [Table] attribute on '{0}' is ignored because the type is {1}",
×
NEW
84
        category: Category,
×
NEW
85
        defaultSeverity: DiagnosticSeverity.Warning,
×
NEW
86
        isEnabledByDefault: true,
×
NEW
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."
×
NEW
88
    );
×
89
}
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