Skip to content

False positive on String.Empty #32

@ArXen42

Description

@ArXen42

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?)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions