Dev.to AI 🤖 Ai 👁 0

AI-generated code brought typography into my repository, so I wrote a Roslyn analyzer

I kept running into characters like: — “ ” ’ … − They usually arrive through copy/paste, documentation tools, or AI-generated content. Most of the time, the compiler does not care. But diffs, searches, reviews and rep

I kept running into characters like:

— “ ” ’ … −

They usually arrive through copy/paste, documentation tools, or AI-generated content.

Most of the time, the compiler does not care. But diffs, searches, reviews and repository consistency sometimes do.

So I built a small Roslyn analyzer for it:

Coree.Analyzers.Typography

It detects configurable typographic Unicode characters during development and build, and it can also inspect additional project files such as Markdown, JSON or YAML.

NuGet:
https://www.nuget.org/packages/Coree.Analyzers.Typography/

Source:
https://github.com/carsten-riedel/Coree.Analyzers

The goal is not to ban Unicode. It is simply to make accidental typography visible and let the project decide what is acceptable.

And if enough of us install it, maybe the .NET ecosystem can still be saved from the em dash. Or at least our README files and AI summaries. :)

Useful little guardrail, or pure developer pedantry?

Also curious: which characters or edge cases would you expect something like this to catch?

📰 Read the original article on Dev.to AI

Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.