dotnet / dotnet/roslynator

Lack of symmetry in refactorings vs analyzers

Open
#327 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
3.5k
Forks
294
Avg merge
2h 30m
Merged PRs (30d)
4

Description

For refactorings, we have both RR0168 `Use "" instead of string.Empty` and its inverse RR0171, `Use string.Empty instead of ""`.

But for analyzers, we have RCS1078, `Use "" instead of string.Empty` which corresponds with RR0168, but no corresponding analyzer for RR0171. This seems like an omission.

Also, I'm confused why RR0168 is enabled by default whereas RR0171 is disabled - to my mind it should be the other way around, as using a readonly field is always safer than a literal. Is this simply a coding style choice on your part?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.