Skip to content

Move analyzer package references from Directory.Build.props to src csproj#84

Merged
Chris-Wolfgang merged 1 commit intomainfrom
chore/move-analyzers-to-csproj
Apr 25, 2026
Merged

Move analyzer package references from Directory.Build.props to src csproj#84
Chris-Wolfgang merged 1 commit intomainfrom
chore/move-analyzers-to-csproj

Conversation

@Chris-Wolfgang
Copy link
Copy Markdown
Owner

Summary

Moves the analyzer NuGet package references and the `BannedSymbols.txt` `AdditionalFiles` entry out of `Directory.Build.props` and into `src/Wolfgang.TryPattern/Wolfgang.TryPattern.csproj`.

Packages moved:

  • Roslynator.Analyzers
  • AsyncFixer
  • Microsoft.VisualStudio.Threading.Analyzers
  • Microsoft.CodeAnalysis.BannedApiAnalyzers
  • Meziantou.Analyzer
  • SonarAnalyzer.CSharp

Behavior change

Before: every project in the repo (src, tests, benchmarks, examples) inherited the analyzers.

After: only the shipped library project (`Wolfgang.TryPattern`) gets the analyzers. Tests, benchmarks, and examples build without analyzer warnings/errors.

`Directory.Build.props` still applies repo-wide for language/build settings:

  • `LangVersion`
  • `EnableNETAnalyzers` / `AnalysisLevel` / `EnforceCodeStyleInBuild`
  • `TreatWarningsAsErrors` (Release only)

Verification

  • `dotnet build --configuration Release` → succeeds with 0 warnings, 0 errors across all TFMs
  • `dotnet test` → 96/96 tests pass on net10.0

🤖 Generated with Claude Code

…proj

Analyzer packages (Roslynator, AsyncFixer, Microsoft.VisualStudio.Threading,
BannedApiAnalyzers, Meziantou, SonarAnalyzer) and the BannedSymbols.txt
AdditionalFiles entry now live in the source library project's csproj
instead of being inherited by every project in the repo.

Behavior change: tests, benchmarks, and examples no longer get analyzer
warnings/errors. Only the shipped library code (Wolfgang.TryPattern) is
subject to analyzer enforcement. Directory.Build.props retains the
property settings (LangVersion, EnableNETAnalyzers, AnalysisLevel,
EnforceCodeStyleInBuild, TreatWarningsAsErrors) which still apply repo-wide.

Verified: dotnet build succeeds with 0 warnings, all 96 tests pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Chris-Wolfgang Chris-Wolfgang merged commit e24490f into main Apr 25, 2026
5 of 6 checks passed
@Chris-Wolfgang Chris-Wolfgang deleted the chore/move-analyzers-to-csproj branch April 25, 2026 16:22
Chris-Wolfgang added a commit that referenced this pull request Apr 25, 2026
Resolves merge conflict with main (PR #84 moved Meziantou.Analyzer
from Directory.Build.props to src/Wolfgang.TryPattern.csproj).
Applies the Dependabot version bump in the new location.

---
updated-dependencies:
- dependency-name: Meziantou.Analyzer
  dependency-version: 3.0.54
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Co-Authored-By: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Chris-Wolfgang added a commit that referenced this pull request Apr 25, 2026
Resolves merge conflict with main (PR #84 moved Meziantou.Analyzer
from Directory.Build.props to src/Wolfgang.TryPattern.csproj).
Applies the Dependabot version bump in the new location.

---
updated-dependencies:
- dependency-name: Meziantou.Analyzer
  dependency-version: 3.0.54
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Co-Authored-By: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
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.

1 participant