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

CA1305 false positives: Convert.ToString(bool), Convert.ToChar(string), Convert.ToBoolean(strng) #7154

Open
MaceWindu opened this issue Jan 21, 2024 · 0 comments · May be fixed by #7244
Open
Labels
Area-Microsoft.CodeAnalysis.NetAnalyzers False_Positive A diagnostic is reported for non-problematic case help wanted The issue is up-for-grabs, and can be claimed by commenting
Milestone

Comments

@MaceWindu
Copy link

MaceWindu commented Jan 21, 2024

Analyzer

Diagnostic ID: CA1305: Specify IFormatProvider

Analyzer source

NuGet Package: Microsoft.CodeAnalysis.NetAnalyzers

Version: 3.11.0-beta1.23525.2 (Latest)

Describe the bug

CA1305 still complains about some methods that doesn't benefit from IFormatProvider

Steps To Reproduce

Convert.ToString(true);
Convert.ToChar("x");
Convert.ToBoolean("true")

Expected behavior

methods should be ignored by analyzer

Actual behavior

CA1305 generated

@MaceWindu MaceWindu changed the title CA1305 false positives: Convert.ToString(bool), Convert.ToChar(string) CA1305 false positives: Convert.ToString(bool), Convert.ToChar(string), Convert.ToBoolean(strng) Jan 21, 2024
@mavasani mavasani added Area-Microsoft.CodeAnalysis.NetAnalyzers help wanted The issue is up-for-grabs, and can be claimed by commenting False_Positive A diagnostic is reported for non-problematic case labels Jan 22, 2024
@mavasani mavasani added this to the Unknown milestone Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Microsoft.CodeAnalysis.NetAnalyzers False_Positive A diagnostic is reported for non-problematic case help wanted The issue is up-for-grabs, and can be claimed by commenting
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants