This repo is frequently edited with Codex/agentic tooling. These notes capture local conventions so automated changes stay consistent and low-friction for maintainers.
- Primary dev OS: Windows.
- Prefer Windows-style paths in docs/examples (
src\Geren.Client\...), and be mindful that PowerShell uses;to chain commands (not&&/||). - Keep generated text files consistent with repo EOL expectations (prefer
\ninside generated sources; normalize when emitting).
- Generators must only emit code via Roslyn (
context.AddSource/spc.AddSource). Do not write files to disk from a generator. - Keep pipelines incremental and narrow:
- Filter inputs early (skip non-owned
AdditionalFilessilently). - Prefer small, dedicated
RegisterSourceOutputregistrations over monolithic “do everything” blocks. - Ensure outputs are deterministic (stable ordering, stable hint names).
- Filter inputs early (skip non-owned
- Treat
AdditionalFilescarefully:- Do not warn/error for files not explicitly opted-in for this generator.
- Use
AnalyzerConfigOptionsProvider+build_metadata.AdditionalFiles.*to identify opted-in files.
- When using custom
AdditionalFilesmetadata (e.g.,Geren="true"), it must be made compiler-visible:- Package scenario: ship
build/+buildTransitive/.propsthat addCompilerVisibleItemMetadata. - ProjectReference/manual analyzer scenario: consumers may need the equivalent
CompilerVisibleItemMetadatain their project/Directory.Build.props.
- Package scenario: ship
- If a generator needs MSBuild properties from
AnalyzerConfigOptionsProvider, ensure they are requested viaCompilerVisibleProperty.
- Generated code should compile cleanly and follow the repo’s
.editorconfigconventions. - Prefer:
#nullable enable- explicit namespaces
- no trailing whitespace
- deterministic formatting (avoid culture-sensitive formatting; keep stable indentation)
- If you change configuration knobs or expected usage, update
README.mdaccordingly.
- When a package relies on MSBuild integration (props/targets), prefer
buildTransitive/for transitive behavior. - Keep
scripts\Invoke-NuGetPipeline.ps1in sync with packaging changes:- If you add/remove packed files, update
RequiredEntrieschecks.
- If you add/remove packed files, update
- If you add an MSBuild import file (
.props/.targets), ensure it is included in the.csprojwithPack="true"and correctPackagePath.
- The exporter is a separate console tool and is built in CI; keep its dependencies compatible with MSBuild loading rules (watch
Microsoft.Build.*references andMicrosoft.Build.Locatorguidance).