Repository navigation
feat(detect): recognize C# and its Roslyn analyzers - #616
Conversation
Report C# from a .csproj, and Roslynator, StyleCop and SonarAnalyzer as separate linters from their NuGet packages, their config files, and their diagnostic ids in .editorconfig or .globalconfig.
|
@claude /review |
|
Claude finished @theCodeDrift's task in 4m 16s —— View job Review: feat(detect): recognize C# and its Roslyn analyzersReview mode: incremental — read 0 prior review thread(s) before reviewing. The only pre-existing content on this PR is the Todo
AssessmentThis is a clean, well-scoped addition. I traced the new C#/Roslynator/StyleCop/SonarAnalyzer signals end-to-end against
One minor, non-blocking observation:
The author's own callout about pruning Test coverage is thorough: positive cases per evidence type (project file, shared No inline comments posted — nothing here rises to the level of a concrete defect. |
Declining the repeated — AI Coding Agent |
taskless detecthad no notion of C#, so a .NET repository reported no language and no linter. This adds C#, plus Roslynator, StyleCop and SonarAnalyzer.Each analyzer is reported under its own name, not as one
roslynentry: people know the tool they installed, not the platform under it.What gets detected
.editorconfig/.globalconfigroslynatorRoslynator.Analyzers,.Formatting.Analyzers,.CodeAnalysis.Analyzers,.DotNet.Cli.roslynatorconfigroslynator_*,dotnet_diagnostic.RCS*,category-roslynatorroslynator analyze|fix|format, or installing the CLIstylecopStyleCop.Analyzersstylecop.json,.stylecop.jsondotnet_diagnostic.SA*sonaranalyzerSonarAnalyzer.CSharpSonarLint.xmldotnet_diagnostic.S<digit>*C#comes from a.csproj. A.slndoes not count, since it can hold any language.PackageReferenceandGlobalPackageReferencein.csproj,.propsand.targets, pluspackages.configanddotnet-tools.json.PackageVersionpin, since central package management can pin a package no project uses.Worth a reviewer's attention
binandobjare now pruned for every repository, not only .NET ones, as .NET build output.languageStackdoes not report C#. It probes exact root paths and a project file has no fixed name.CArules, which ship with the toolchain and need signals of their own.Sources
Package ids, config files and
RCS/SAids come from the Roslynator, StyleCop Analyzers, sonar-dotnet and NuGet docs. Three things do not: Sonar'sS<digits>format is inferred from the README'sS107example, and thedotnet-tools.jsonshape andGlobalPackageReferencecome from general .NET knowledge. Roslynator's use of.globalconfigis also inferred; its docs name only.editorconfigand the global AnalyzerConfig format of.roslynatorconfig.Tested with fixtures and one synthetic repository, not a real .NET project.
Verification
pnpm typecheck,pnpm lintandpnpm --filter @taskless/cli testpass. The OpenSpec change is archived in this PR, withcli-detectgoing from 33 to 44 scenarios and none dropped.