MO

moq-analyzers-config-and-flags

A reference guide for managing configuration axes in moq.analyzers, including build properties, severity levels, and environment variables.

Install

mkdir -p .claude/skills/moq-analyzers-config-and-flags && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/16589" && unzip -o skill.zip -d .claude/skills/moq-analyzers-config-and-flags && rm skill.zip

Installs to .claude/skills/moq-analyzers-config-and-flags

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Catalogs every configuration axis in moq.analyzers — MSBuild properties (PedanticMode, ContinuousIntegrationBuild, LangVersion, AnalysisMode), analyzer severity layers (.editorconfig, .globalconfig, stylecop.json, GlobalSuppressions.cs, pragmas), BannedSymbols.txt, test.runsettings, CI env vars (FORCE_PERF_BASELINE, RUN_FULL_PERF, DOTNET_ROLL_FORWARD), renovate.json pins, build/perf/baseline.json, version.json/NBGV, and dotnet-tools.json. Load when a build behaves differently locally vs CI, when a warning appears/disappears unexpectedly, when adding/changing any flag or config file, when a diagnostic must be suppressed or re-severitied, when a dependency pin blocks an update, or when perf baseline/env-var semantics are unclear. Do NOT load for build/test command basics (use moq-analyzers-build-and-env), for dependency-pin incident history (moq-analyzers-failure-archaeology), for PR/merge process (moq-analyzers-change-control), or for shipping/retiring a rule (moq-analyzers-rule-lifecycle).
1004 chars✓ has a “when” triggerlonger than Claude Code's old 250-char listing cap (fine on current versions)
Advanced

Key capabilities

  • Catalog MSBuild properties
  • Catalog analyzer severity layers
  • Catalog BannedSymbols.txt configurations
  • Catalog test.runsettings configurations
  • Catalog CI environment variables
  • Catalog Renovate rules

How it works

The skill documents various configuration axes within moq.analyzers, detailing their files, default values, and potential impact.

Inputs & outputs

You give it
A request to understand moq.analyzers configuration
You get back
A catalog of configuration axes, their defaults, and impact

When to use moq-analyzers-config-and-flags

  • Troubleshoot build behavior differences between local and CI
  • Suppress or change severity of diagnostic warnings
  • Adjust analyzer configuration axes
  • Check environment variable semantics

About this skill

moq.analyzers configuration and flags catalog

Every knob in this repo, what it defaults to, who may change it, and what catches a bad change. This repo ships a Roslyn analyzer (a plugin that runs inside consumers' compilers and IDEs), so several "configuration" entries are actually load-bearing safety pins — changing them can crash customer builds.

All file paths are repo-root relative. All quotes verified against the working tree on 2026-07-02 (commit 05135b2).

Change control baseline: CODEOWNERS is * @rjmurillo — every file below is owner-reviewed. Nothing here documents a way around that; see moq-analyzers-change-control before touching any axis marked LOAD-BEARING.

Axis map (read this first)

#AxisFile(s)Blast radius if wrong
1MSBuild propertiesbuild/targets/*/*.props, build/targets/codeanalysis/CodeAnalysis.targets, Directory.Build.props/.targetsLocal build passes, CI fails (or vice versa)
2Analyzer severity layers.editorconfig (root + 3 nested), build/targets/codeanalysis/.globalconfig, stylecop.json, GlobalSuppressions.csWarnings silently vanish, or CI self-locks
3Banned APIssrc/BannedSymbols.txtWrong Roslyn API patterns re-enter the codebase
4Test run settingsbuild/targets/tests/test.runsettings, Tests.targets, xunit.runner.jsonCoverage numbers lie; tests serialize
5CI/env variables.github/workflows/main.yml, build/scripts/hooks/Invoke-PrePushBuild.ps1, build/scripts/perf/PerfCore.ps1Perf gate runs wrong suite; pre-push breaks
6Renovate rulesrenovate.jsonCS8032 crash ships to customers (LOAD-BEARING)
7Perf baselinebuild/perf/baseline.jsonPerf gate compares against wrong commit
8Versioningversion.json, global.jsonWrong package version pushed to nuget.org
9Pinned CLI tools.config/dotnet-tools.jsonHooks/CI tool steps fail or drift

Axis 1 — MSBuild properties

MSBuild properties are name/value pairs evaluated during dotnet build. This repo centralizes them in build/targets/<area>/{*.props,*.targets} pairs, imported by root Directory.Build.props (props) and Directory.Build.targets (targets), which MSBuild auto-imports into every project.

PedanticMode — the single most important flag

Exact text of build/targets/codeanalysis/CodeAnalysis.targets (entire file, 2026-07-02):

<Project>
  <PropertyGroup Label="Computed properties">
    <PedanticMode Condition=" '$(PedanticMode)' == '' ">$([MSBuild]::ValueOrDefault('$(ContinuousIntegrationBuild)', 'false'))</PedanticMode>
    <TreatWarningsAsErrors>$(PedanticMode)</TreatWarningsAsErrors>
    <MSBuildTreatWarningsAsErrors>$(PedanticMode)</MSBuildTreatWarningsAsErrors>
  </PropertyGroup>
</Project>

Semantics:

  • PedanticMode defaults to whatever ContinuousIntegrationBuild is (false when unset). It drives BOTH TreatWarningsAsErrors (C# compiler warnings become errors) and MSBuildTreatWarningsAsErrors (MSBuild-level warnings become errors).
  • CI always builds with /p:ContinuousIntegrationBuild=true (see .github/actions/setup-restore-build/action.yml, Build step), so CI is always pedantic. A plain local dotnet build is NOT.
  • Consequence: any warning passes locally and fails CI. Always run the CI-parity build before pushing:
dotnet build Moq.Analyzers.sln --configuration Release /p:PedanticMode=true /p:Deterministic=true /p:ContinuousIntegrationBuild=true /p:UseSharedCompilation=false /p:BuildInParallel=false /nodeReuse:false

(That is verbatim the flag set from build/scripts/hooks/Invoke-PrePushBuild.ps1, which the pre-push git hook runs for you.)

Full property table

PropertyValueSet inWhy
PedanticModedefault = $(ContinuousIntegrationBuild), else falsebuild/targets/codeanalysis/CodeAnalysis.targets:3Warnings-as-errors switch (above)
TreatWarningsAsErrors / MSBuildTreatWarningsAsErrors$(PedanticMode)same fileEscalation
ContinuousIntegrationBuild / Deterministicnot set in repo files; passed as /p: by CI composite action and pre-push hook.github/actions/setup-restore-build/action.yml, build/scripts/hooks/Invoke-PrePushBuild.ps1Reproducible builds (DotNet.ReproducibleBuilds 2.0.5, build/targets/reproducible/)
ArtifactsPath$(RepoRoot)/artifactsbuild/targets/artifacts/Artifacts.propsAll bin/obj/test/package output lands under artifacts/
ArtifactsTestResultsPath$(ArtifactsPath)/TestResultssame fileTRX + coverage output root
LangVersiondefaultbuild/targets/compiler/Compiler.propsDeliberately floats with the SDK pinned in global.json. Do NOT hard-pin a C# version; the shipped assembly still compiles against Roslyn 4.8 (ADR-003)
Nullableenablesame fileRepo-wide nullable reference types
ImplicitUsingsenablesame fileGlobal usings on
EnableNETAnalyzerstruebuild/targets/codeanalysis/CodeAnalysis.propsBuilt-in CA rules on
EnforceCodeStyleInBuildtruesame fileIDExxxx style rules fail the build (under PedanticMode)
AnalysisModepreviewsame fileMost aggressive built-in analyzer mode, including preview rules
WarningLevel9999same fileAll current and future compiler warning waves enabled
GenerateDocumentationFiletruesame fileXML docs required (missing-doc warnings become CI errors)
EnforceExtendedAnalyzerRulestrue, only for projects Moq.Analyzers and Moq.Analyzers.Testsame file, conditioned on $(MSBuildProjectName)Opts into analyzer-authoring rules (resolves RS1036); the RS-family rules police analyzer correctness
RepoRoot$(MSBuildThisFileDirectory)Directory.Build.propsUsed by every other path
ManagePackageVersionsCentrally + CentralPackageTransitivePinningEnabledtrueDirectory.Packages.propsCentral Package Management (CPM): every package version lives in Directory.Packages.props or an imported build/targets/*/Packages.props; transitive dependencies are pinned too (ADR-005)
HUSKYenv var; 0 skips git-hook installDirectory.Build.targets HuskyInstall targetHooks auto-install on restore unless CI or HUSKY=0
  • Who may change: repo owner via PR. Property changes are infrastructure changes — cite the affected build/targets/ file in the PR.
  • Guard: CI-parity build (pre-push hook + main.yml build job). There is no guard that detects loosening (e.g., lowering WarningLevel) other than code review — treat any diff under build/targets/ as high-scrutiny.

The one property trap with an incident behind it (2026-07-02)

Never configure S1135 ("track TODO tags") above suggestion. Under PedanticMode, S1135 = warning turns every TODO comment into a CI error and locks CI against itself (commit 3d4f7ff did this and was reverted the next day by b1439ab; the tripping build error was an issue-linked TODO(#1012) comment — #1012 itself tracks an unrelated enhancement, not this incident; see moq-analyzers-failure-archaeology §4). The current, correct setting is .editorconfig:420dotnet_diagnostic.S1135.severity = suggestion. TODO discipline is enforced by a different mechanism entirely (build/scripts/todo-scanner/Scan-TodoComments.ps1, pre-push).


Axis 2 — Analyzer severity configuration (the precedence story)

"Severity" is how loudly a diagnostic (e.g. CA1016, SA1101, Moq1200) reports: error > warning > suggestion > silent > none. Multiple files can set it; precedence, strongest first:

LevelMechanismThis repo's instances
1In-source: #pragma warning disable <ID> / [SuppressMessage] (incl. GlobalSuppressions.cs)src/Analyzers/GlobalSuppressions.cs and tests/Moq.Analyzers.Test/GlobalSuppressions.cs — each suppresses exactly one rule: SA1503 (braces). Inline [SuppressMessage] also appears in code with written justifications (e.g. MA0051 in the MockBehavior analyzers)
2.editorconfig dotnet_diagnostic.<ID>.severity — nearest file to the source wins; deeper folders override shallowerRoot .editorconfig (422 lines, root = true) plus three nested overrides: tests/.editorconfig, src/tools/.editorconfig, src/tools/PerfDiff/.editorconfig
3Global AnalyzerConfig (.globalconfig) — loses to any .editorconfig entry for the same IDbuild/targets/codeanalysis/.globalconfig, wired via <GlobalAnalyzerConfigFiles> in CodeAnalysis.props:17
4The rule's own DiagnosticDescriptor default (defaultSeverity, isEnabledByDefault)Each analyzer source file in src/Analyzers/

On top of whichever severity wins, PedanticMode=true escalates every surviving warning to error (Axis 1). There are no <NoWarn> properties and no .ruleset files anywhere in this repo (verified 2026-07-02) — do not introduce them; the layers above are the sanctioned mechanisms.

What each file is for

  • Root .editorconfig — the main severity ledger plus formatting rules. Notable pinned entries (2026-07-02): SA1633 = silent (no file headers), SA1101 = silent (no this. prefix), SA1600 = silent, CA1016 = none (line 407 — Codacy false positive, suppressed deliberately per incident 58924f7/2a7ee34; do not "fix" it), MA0040 = error, CA2016 = error (CancellationToken forwarding — load-bearing for analyzer responsiveness), S1135 = suggestion (NEVER raise; see Axis 1 trap), MA0026 = none. It also carries the ADR-010 section forcing end_of_line = lf for *.ps1/psm1/psd1 (a CRLF PowerShell file once broke the pre-push hook, issue #1081) and a section protecting Verify snapshot files (*.{received,verified}.*) from newline/whitespac

Content truncated.

When not to use it

  • For build/test command basics
  • For dependency-pin incident history
  • For PR/merge process

Limitations

  • Does not document a way around CODEOWNERS approval
  • Does not cover build/test command basics
  • Does not cover dependency-pin incident history

How it compares

This skill provides a centralized, verified catalog of all configuration points for moq.analyzers, which is more systematic than manually inspecting individual files.

Compared to similar skills

moq-analyzers-config-and-flags side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
moq-analyzers-config-and-flags (this skill)01moReviewAdvanced
shellcheck-configuration92moNo flagsIntermediate
wolf-scripts-core59moReviewIntermediate
final-release-review55moReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

Search skills

Search the agent skills registry