AI-generated code brought typography into my repository, so I wrote a Roslyn analyzer
Description and use
A Roslyn analyzer detects typographic Unicode characters in code and documentation, reducing diff noise and improving repository consistency.
Problem
Typographic Unicode characters such as smart quotes, em dashes, and ellipses inadvertently enter code and documentation via copy/paste, AI-generated content, or documentation tools, causing inconsistencies in diffs, searches, and reviews.
Outcome
The analyzer surfaces typographic Unicode characters across code and documentation, reducing diff noise and improving repository consistency.
Workflow
- 1. Install the Coree.Analyzers.Typography NuGet package.
- 2. Add the analyzer to the project’s .csproj or global analyzer configuration.
- 3. Configure the set of typographic characters to flag via analyzer options.
- 4. Run the build or IDE analysis to surface violations.
- 5. Review and replace or approve the flagged characters in source and documentation files.
Evidence
It detects configurable typographic Unicode characters during development and build, and it can also inspect additional project files such as Markdown, JSON or YAML.
- Record date: 2026-09-21T23:45:46.677Z