Class BowireSchemaLinter
- Namespace
- Kuestenlogik.Bowire.Linting
- Assembly
- Kuestenlogik.Bowire.dll
Runs a set of IBowireLintRule over a discovered API surface
and collects their BowireLintFinding. The typed rule engine
behind design-time API validation (#189): the same discovery snapshot the
workbench, bowire diff, and the PR bot use is checked here for design
smells before a single request is sent.
public sealed class BowireSchemaLinter
- Inheritance
-
BowireSchemaLinter
- Inherited Members
Constructors
BowireSchemaLinter(IEnumerable<IBowireLintRule>)
Create a linter over an explicit rule set.
public BowireSchemaLinter(IEnumerable<IBowireLintRule> rules)
Parameters
rulesIEnumerable<IBowireLintRule>
Properties
DefaultRules
The built-in rules, in declaration order.
public static IReadOnlyList<IBowireLintRule> DefaultRules { get; }
Property Value
RuleIds
The ids of the rules this linter runs.
public IReadOnlyList<string> RuleIds { get; }
Property Value
Methods
CreateDefault()
A linter loaded with the built-in DefaultRules.
public static BowireSchemaLinter CreateDefault()
Returns
CreateWithDiscoveredRules(ILogger?)
A linter loaded with the built-ins plus any plugin rules discovered via DiscoverRules(ILogger?). The CLI / endpoint / MCP surfaces use this so a custom rule lights up on every surface at once.
public static BowireSchemaLinter CreateWithDiscoveredRules(ILogger? logger = null)
Parameters
loggerILogger
Returns
DiscoverRules(ILogger?)
Build the rule set from the built-in DefaultRules plus every
IBowireLintRule with a public parameterless constructor found
in a loaded Kuestenlogik.Bowire* assembly — the plugin SPI (#189):
a sibling package or host drops in a rule type and it shows up in
bowire lint, the workbench Lint rail, and the bowire.lint MCP
tool alike. Duplicate rule ids are dropped (first wins), so the built-ins
are never double-counted when Core is scanned. Defensive — a single bad
assembly or rule type is skipped, not fatal.
public static IReadOnlyList<IBowireLintRule> DiscoverRules(ILogger? logger = null)
Parameters
loggerILogger
Returns
Lint(IReadOnlyList<BowireServiceInfo>, BowireLintConfig?)
Lint every service with every rule. Findings come back grouped by service in input order, then by rule in registration order — a stable order so a report or a diff of two runs reads the same each time.
An optional config (from .bowire/rules.json)
skips rules turned enabled: false and remaps a finding's severity
when the rule carries a severity override. A null config runs every rule
at its built-in severity.
public IReadOnlyList<BowireLintFinding> Lint(IReadOnlyList<BowireServiceInfo> services, BowireLintConfig? config = null)
Parameters
servicesIReadOnlyList<BowireServiceInfo>configBowireLintConfig