Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

False positive on String.Empty #32

Closed
ArXen42 opened this issue Jun 1, 2018 · 2 comments
Closed

False positive on String.Empty #32

ArXen42 opened this issue Jun 1, 2018 · 2 comments

Comments

@ArXen42
Copy link

ArXen42 commented Jun 1, 2018

I'm moving old project from hand-written logger to Serilog. As a temporary solution, some of old usages were replaced with such code:
image

Although, formally, analyzer is right (String.Empty is not a constant) and this is actually a bad practice, it is clear that this field will never contain anything other than empty string. Shouldn't String.Empty case be exceptional? (and, may be, separate code smell rule to warn about empty string template?)

@Suchiman
Copy link
Owner

Suchiman commented Jun 1, 2018

@ArXen42 I've pushed 0.14 to nuget and visualstudiogallery which treats String.Empty the same as ""

@ArXen42
Copy link
Author

ArXen42 commented Jun 1, 2018

@Suchiman Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants