Skip to content

build: run the JustDummies analyzers on our own code (ADR-0061) - #379

Merged
Reefact merged 1 commit into
mainfrom
claude/justdummies-analyzers-analysis-z9q1xd
Jul 29, 2026
Merged

build: run the JustDummies analyzers on our own code (ADR-0061)#379
Reefact merged 1 commit into
mainfrom
claude/justdummies-analyzers-analysis-z9q1xd

Conversation

@Reefact

@Reefact Reefact commented Jul 29, 2026

Copy link
Copy Markdown
Owner

Summary

Accepts ADR-0061 and implements it: the JustDummies analyzers now load at build and in the IDE on every project in this repository that consumes JustDummies, so the rules are verified continuously against code that was not written to please them.

Type of change

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

Changes

ADR-0061 accepted. Status: Accepted, with Accepted: 2026-07-29 added below Proposed: rather than replacing it (ADR-0057). Index and French translation updated.

Eight projects wired — both JustDummies suites, the xUnit adapter and its suite, FirstClassErrors' own suite, the Testing package and its suite, and the binder's suite.

Two consumers deliberately left out, each with the reason recorded in the project file where someone would otherwise "fix" the omission:

Excluded Why
JustDummies.Analyzers.UnitTests Its subject is these analyzers. Loading them into the compilation that builds them makes the analyzer under test also the analyzer running, and a rule changed there would report on the source that defines it. This is the circularity ADR-0061 names among its risks.
tools/justdummies-check Consumes the packed package on purpose, so asset selection is exercised as a real consumer sees it. Wiring would require the ProjectReference that project exists to avoid, and a diagnostic about how the library is called says nothing about which asset NuGet resolved.

The two duplicate-collapsing tests gain the suppression the other five sites already carried: the duplicate is the subject, and without it there is nothing to collapse.

Three things measured, not assumed

1. A planted violation fires in all eight wired projects. This mattered more than it looks: a clean build would read identically whether the analyzers are clean or were never loaded at all — which is exactly the trap an earlier sweep fell into, when Info rules stayed silent and the sweep looked green. The control proves loading.

2. Neither shipped package gained a dependency. Both JustDummies.Xunit and FirstClassErrors.Testing are packable, unlike the sample the FirstClassErrors analyzers are dogfooded on, so a ProjectReference could have leaked into their nuspec. Packing and reading the dependency lists:

Package Dependencies after wiring
JustDummies.Xunit JustDummies, xunit.v3.extensibility.core
FirstClassErrors.Testing FirstClassErrors

No JustDummies.Analyzers. PrivateAssets="all" keeps the analyzer off the shipped surface.

3. The whole solution is clean. Zero diagnostics in Debug and Release, with 28 rules running across eight projects.

Testing

  • dotnet build FirstClassErrors.sln — 0 warnings, 0 errors (Debug and Release, --no-incremental)
  • dotnet test FirstClassErrors.sln — 2 168 tests, 0 failures across all 13 test projects
  • Analyzer tests pass (FirstClassErrors.Analyzers.UnitTests, 132; JustDummies.Analyzers.UnitTests, 246)
  • dotnet build JustDummies.UnitTests -c Release -f net472 -p:EnableNet472Floor=true and the same for JustDummies.PropertyTests — both floor legs clean
  • Planted positive control fires in all eight wired projects, then removed
  • dotnet pack on both packable consumers, dependency lists read from the nuspec

Mutation testing was not run locally.

Documentation

  • Public API / error documentation updated — no public API change
  • README / doc/ updated — ADR-0061 status and the ADR index
  • French translation updated — the ADR's .fr.md header
  • No documentation change required

Architecture decisions

  • No architectural decision in this pull request
  • New decision recorded — ADR drafted as Proposed: ADR-0061
  • Supersedes an existing ADR — successor proposed, status not flipped: ADR-____
  • ⚠️ Conflicts with an existing ADR — flagged for the maintainer: ADR-____

ADR-0061 was drafted as Proposed in #377 and is flipped to Accepted here on @Reefact's explicit instruction, not unilaterally.

What this does not cover

The ADR's follow-up actions stay open, and one of them qualifies how much this PR actually buys:

This verifies the loud rules. JD020, JD022 and JD024 are Info and do not surface at default build verbosity; JD011 and JD019 ship disabled. A clean build therefore reads as full coverage while five of the 28 rules are not being exercised at all. Escalating them is a separate decision, which ADR-0061 states as a risk and carries as follow-up rather than smuggling in here.

The other two follow-ups — whether the opt-in pair should be exercised anywhere, and whether the FirstClassErrors analyzers deserve the same treatment beyond FirstClassErrors.Usage — are likewise untouched.

🤖 Generated with Claude Code

https://claude.ai/code/session_01GKqyhG9Y4AfdxEYekP2Evq


Generated by Claude Code

Accepts ADR-0061 and implements it. The record argued that a rule's unit
suite proves only that it fires on a snippet its own author wrote for it,
so a wrong model of the library passes both sides — and that every model
error the catalogue has had was caught instead on realistic code, by a
sweep nothing in the repository asked for.

Eight projects now load the analyzers at build and in the IDE: the two
JustDummies suites, the xUnit adapter and its suite, FirstClassErrors'
own suite, the Testing package and its suite, and the binder's suite.

Two consumers are deliberately left out, each with the reason recorded
where someone would otherwise "fix" the omission:

  * JustDummies.Analyzers.UnitTests — its subject IS these analyzers.
    Loading them into the compilation that builds them makes the analyzer
    under test also the analyzer running, and a rule changed there would
    report on the source that defines it. This is the circularity the ADR
    names among its risks.
  * tools/justdummies-check — consumes the PACKED package on purpose, so
    that asset selection is exercised as a real consumer sees it. Wiring
    would require the ProjectReference that project exists to avoid, and
    a diagnostic about how the library is called says nothing about which
    asset NuGet resolved.

The two duplicate-collapsing tests gain the suppression the other five
sites already carried: the duplicate IS the subject, and without it there
is nothing to collapse.

Three things were measured rather than assumed. The whole solution builds
with zero diagnostics in Debug and in Release, and 2 168 tests pass. A
planted violation fires in all eight wired projects, so a clean build
means clean rather than never-loaded — the trap an earlier sweep fell
into. And packing JustDummies.Xunit and FirstClassErrors.Testing shows
no new dependency: PrivateAssets keeps the analyzer off the shipped
surface, which matters because both are packable, unlike the sample the
FirstClassErrors analyzers are dogfooded on.

The net472 floor legs build.

The ADR's follow-up actions stay open. In particular this verifies the
LOUD rules: JD020, JD022 and JD024 are Info and do not surface at default
verbosity, and JD011 and JD019 ship disabled. A clean build reads as full
coverage while those five are not exercised, which is the risk the record
states and defers.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GKqyhG9Y4AfdxEYekP2Evq
@Reefact
Reefact merged commit 4df8cad into main Jul 29, 2026
29 checks passed
@Reefact
Reefact deleted the claude/justdummies-analyzers-analysis-z9q1xd branch July 29, 2026 21:17
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.

2 participants