rjmurillo / EffectiveCSharp.Analyzers

Many of the recommendations in the book Effective C#: 50 Specific Ways to Improve Your C# can be validated by Roslyn-based analyzers and code fixes.
MIT License
2 stars 1 forks source link

Add Roslyn Analyzer for Replacing `string.Format` with Interpolated Strings (ECS0004) #41

Closed rjmurillo closed 2 months ago

rjmurillo commented 2 months ago

This pull request introduces a new Roslyn analyzer and code fix to enforce the use of interpolated strings instead of string.Format. This change addresses the recommendations outlined in Effective C#: 50 Specific Ways to Improve your C#.

Rule Details

Rule ID: ECS0004

Title: Replace string.Format with interpolated string

Category: Style

Description: This rule identifies instances of string.Format and suggests replacing them with C# interpolated strings for improved readability and reduced error potential.

codacy-production[bot] commented 2 months ago

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
:white_check_mark: +3.00% (target: -1.00%) :white_check_mark: 94.05%
Coverage variation details | | Coverable lines | Covered lines | Coverage | | ------------- | ------------- | ------------- | ------------- | | Common ancestor commit (5da647e447fad4eb0a9e3db287e1d16cce316114) | 356 | 278 | 78.09% | | | Head commit (a9d852010fc06b536a18c918c25bbda268abbd7c) | 439 (+83) | 356 (+78) | 81.09% (**+3.00%**) | **Coverage variation** is the difference between the coverage for the head and common ancestor commits of the pull request branch: ` - `
Diff coverage details | | Coverable lines | Covered lines | Diff coverage | | ------------- | ------------- | ------------- | ------------- | | Pull request (#41) | 84 | 79 | **94.05%** | **Diff coverage** is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: `/ * 100%`

See your quality gate settings    Change summary preferences

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more