Skip to content

build(binder): dogfood the FCExxx analyzers on the binder - #182

Merged
Reefact merged 1 commit into
mainfrom
claude/issue-153-explanation-mtznkx
Jul 18, 2026
Merged

build(binder): dogfood the FCExxx analyzers on the binder#182
Reefact merged 1 commit into
mainfrom
claude/issue-153-explanation-mtznkx

Conversation

@Reefact

@Reefact Reefact commented Jul 18, 2026

Copy link
Copy Markdown
Owner

Summary

Wire the FirstClassErrors FCExxx analyzers into the RequestBinder project so its error documentation is enforced at compile time, like the rest of the repository. The binder references FirstClassErrors via a ProjectReference, which — unlike the NuGet package — does not carry the bundled analyzers, so RequestBindingError's [ProvidesErrorsFor] / [DocumentedBy] wiring was the one place not analyzer-checked (only exercised by reflection in BindingContractTests).

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Refactoring
  • Analyzer / diagnostic change
  • Tests
  • Documentation
  • Build / CI / tooling

Changes

  • Add a build-only ProjectReference to FirstClassErrors.Analyzers in FirstClassErrors.RequestBinder.csproj with OutputItemType="Analyzer" (runs the analyzers at build/IDE time), ReferenceOutputAssembly="false" (off the runtime graph), and PrivateAssets="all" (kept out of the published package's dependency graph, since the binder is packed — matching the main library's treatment).
  • Add AnalyzerDogfoodingTests to the binder's unit tests: a guard that reads the binder .csproj and asserts the analyzer reference stays present and correctly shaped (OutputItemType=Analyzer, ReferenceOutputAssembly=false, PrivateAssets=all), so the wiring cannot silently disappear.

Testing

  • dotnet build FirstClassErrors.sln — succeeds, 0 warnings / 0 errors.
  • dotnet test FirstClassErrors.sln — not run in full; ran dotnet test FirstClassErrors.RequestBinder.UnitTests instead: 90/90 passed, including the 2 new guard tests.
  • Analyzer tests (FirstClassErrors.Analyzers.UnitTests) — not run; this PR does not modify the analyzers.

Additional manual verification: temporarily pointed a [DocumentedBy] at a non-existent method to confirm the wiring is live — the binder build then failed with error FCE006 ([DocumentedBy] cannot be resolved) and passed again once reverted. This confirms the analyzers actually run on the binder, not merely that the reference is declared.

Documentation

  • Public API / error documentation updated
  • README / doc/ updated
  • French translation (doc/handwritten/for-users/README.fr.md) updated if user-facing behavior changed
  • No documentation change required — no user-facing behavior changes (the binder's public API and errors are unchanged), and the analyzers.yml workflow is not modified. The binder's dogfooding is enforced by the full-solution build in ci.

Architecture decisions

  • No architectural decision in this pull request — this applies the existing dogfooding pattern (already used by FirstClassErrors.Usage and FirstClassErrors.GenDoc) to the binder. No conflict with ADR 0001 (the Roslyn floor is untouched).
  • New decision recorded — ADR drafted as Proposed: ADR-____
  • Supersedes an existing ADR — successor proposed, status not flipped: ADR-____
  • ⚠️ Conflicts with an existing ADR — flagged for the maintainer: ADR-____

Related issues

Closes #153

🤖 Generated with Claude Code

https://claude.ai/code/session_01Gg4ecN69YmG1yMaW45hGtH


Generated by Claude Code

@Reefact
Reefact force-pushed the claude/issue-153-explanation-mtznkx branch from 220c8d2 to a902349 Compare July 18, 2026 12:51
A ProjectReference to FirstClassErrors carries the runtime library but
not the analyzers bundled in its NuGet package, so the binder's
[ProvidesErrorsFor] / [DocumentedBy] error documentation was the one
place in the repository not enforced at compile time — only exercised by
reflection in BindingContractTests. Reference the analyzer project
explicitly (OutputItemType=Analyzer, ReferenceOutputAssembly=false,
PrivateAssets=all), mirroring Usage and GenDoc, so a break in that
wiring fails the build like everywhere else. A guard test pins the
reference so it cannot silently disappear.

Refs: #153
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Gg4ecN69YmG1yMaW45hGtH
@Reefact
Reefact force-pushed the claude/issue-153-explanation-mtznkx branch from a902349 to bd80f0e Compare July 18, 2026 13:04
@Reefact
Reefact merged commit 3043fa8 into main Jul 18, 2026
13 checks passed
@Reefact
Reefact deleted the claude/issue-153-explanation-mtznkx branch July 18, 2026 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Binder: the FCExxx analyzers are not dogfooded on the RequestBinder project

2 participants