feat: NE0001 — one top-level type per file with matching file name - #8
Conversation
… name) Implements #3. Reports files that declare more than one top-level type or whose single type does not match the file name. Generic overloads are arity-encoded by default (Result{T}.cs) or may share a base-named file when NetEvolveAnalyzerGroupGenericOverloads is set. The rule disables itself for single-file publish (PublishSingleFile) and via NetEvolveAnalyzerDisableFileOrganizationRules. - Analyzer + NE0001 registration + release-tracking entry + docs - Consumer build props expose the CompilerVisibleProperty values it reads - Namespace-scoped type identity, so distinct same-named types in different namespaces are each evaluated (adversarial-review finding) - File-name-aware unit verifier (named sources + build-property injection) and an integration harness with tree path + AnalyzerConfigOptions - 29 unit + 8 integration tests; src coverage: unit 98.9%, integration 88.2%, project 100% Also removes a stray line in AnalyzerReleases.Shipped.md that failed RS2007. Refs #3 #6 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one) (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The test-tree .editorconfig that disabled IDE0058 for TUnit's awaited
assertions is git-ignored (.gitignore rule **/.editorconfig, keeping only the
root .editorconfig), so it never reached CI. There, code-style enforcement
failed on every `await Assert.That(...)` expression statement — including the
pre-existing seed tests. The root .editorconfig is template-managed
("DO NOT CHANGE SETTINGS IN THIS FILE").
Add a committed test/Directory.Build.props that chains to the root props and
sets NoWarn=IDE0058 for all test projects (current and future).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
Closes #3 · part of epic #6
What
Adds NE0001 (Maintainability, Warning): reports a file that declares more than one top-level type, or
whose single top-level type does not match the file name.
class/struct/record/record struct/interface/enum/delegate; nested types ignored.Result.cs,Result{T}.cs,Result{T1,T2}.cs), ormay share a base-named file when
NetEvolveAnalyzerGroupGenericOverloads=true.partialparts of the same type count as one type; namespace-scoped identity so two same-named typesin different namespaces are each evaluated.
PublishSingleFile) and viaNetEvolveAnalyzerDisableFileOrganizationRules.Includes
DiagnosticIds.NE0001+AnalyzerReleases.Unshipped.mdentry +docs/rules/NE0001.mdbuild/NetEvolve.Analyzer.propsexposing theCompilerVisiblePropertyvalues the rule readsnamed-source unit verifier +
AnalyzerCompilerwith tree path andAnalyzerConfigOptionsAnalyzerReleases.Shipped.mdthat failed RS2007Quality
src/: unit 98.9% · integration 88.2% · project 100% (gates 75/80/90/95)with regression tests
Not in this PR
🤖 Generated with Claude Code