You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Proposal] Analyzer that suggests ToUpperInvariant/ToLowerInvariant in place of ToUpper/ToLower #43976
strings="my string";stringlower,upper;// Suggest to use ToLowerInvariant() or to explicitly indicate the culture.// Offer fix to use ToLowerInvariant()lower=s.ToLower();lower="str".ToLower();// Suggest to use ToUpperInvariant() or to explicitly indicate the culture.// Offer fix to use ToUpperInvariant()upper=s.ToUpper();upper="str".ToUpper();CultureInfoculture=newCultureInfo("es-ES",false);// Should not suggestlower=s.ToLower(culture);upper=s.ToUpper(culture);// Should we suggest to use To*Invariant() in these cases? tarekgh thinks it's not necessary, but we can discuss it:// Is this the same as ToLowerInvariant? https://source.dot.net/#System.Private.CoreLib/String.Manipulation.cs,1710lower=s.ToLower(CultureInfo.InvariantCulture);// Is this the same as ToUpperInvariant? https://source.dot.net/#System.Private.CoreLib/String.Manipulation.cs,1725upper=s.ToUpper(CultureInfo.InvariantCulture);
@mavasani This issue was opened back in 2017 before we decided that Roslyn analyzer proposals should be approved in the API review meeting in the runtime repo. It already has a PR opened back in 2019, but it wasn't discussed here or approved. Should we move it to the runtime repo to approve it first?
@jamesqo as suggested in this thread you need to add the proposal up in the issue description.
are you suggesting to have the analyzer suggest ToUpperInvariant/ToLowerInvariant all the time when ToUpper/ToLower show up? or would be depending on the context of the callsite?
Hi @carlossanlop I tested positive for covid and won't be able to get any work done for some time. If you guys need this taken care of urgently, please unassign me from the issue, otherwise I'll get back to it once I'm better.
I apologize for the inconvenience.
Hi @carlossanlop I'm back at it. I see a lot has changed in the repo since I first sent that PR(which is to be expected for a 3 year gap). Originally I added the analyzer source file to the Microsoft.NetCore.Analyzers project. That project is no longer there but I found something similar, I'm thinking the Microsoft.CodeAnalysis.NetAnalyzers project -> Microsoft.NetCore.Analyzers.Runtime folder is the right place for it. Would you agree?
Also I'm thinking of dropping this current PR and creating a new one instead. Doing a merge after this long is proving to be too much of a headache.
@tarekgh@buyaa-n I already proceeded since there was no response for a while. Decided to update the existing PR, it currently has the analyzer in it and I believe it was looked at by some of the team members. All that's missing right now is a fixer. I'll resume working on that next week.
Activity
kharai-tor commentedon Mar 10, 2019
@mavasani created a PR for this - dotnet/roslyn-analyzers#2186
carlossanlop commentedon Oct 28, 2020
@mavasani should this go through API review in the runtime repo, or is this just an improvement to an existing analyzer?
carlossanlop commentedon Oct 28, 2020
@mavasani This issue was opened back in 2017 before we decided that Roslyn analyzer proposals should be approved in the API review meeting in the runtime repo. It already has a PR opened back in 2019, but it wasn't discussed here or approved. Should we move it to the runtime repo to approve it first?
mavasani commentedon Oct 28, 2020
Yes, I agree we need a proposal/triage in runtime repo before taking this forward.
Dotnet-GitSync-Bot commentedon Oct 28, 2020
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.
tarekgh commentedon Oct 29, 2020
@jamesqo as suggested in this thread you need to add the proposal up in the issue description.
are you suggesting to have the analyzer suggest ToUpperInvariant/ToLowerInvariant all the time when ToUpper/ToLower show up? or would be depending on the context of the callsite?
13 remaining items
tarekgh commentedon Jul 19, 2021
I moved this to 7.0 as I am not seeing urgency to have it for 6.0. That is fine if we get a PR for 6.0 too.
kharai-tor commentedon Jul 20, 2021
@tarekgh I won't have any time to work on this in the next 2 months. I'll come back to it afterwards if that works for you guys.
carlossanlop commentedon Sep 14, 2021
@TKharaishvili are you still going to work on this?
kharai-tor commentedon Sep 14, 2021
@carlossanlop yes, I'll have an updated PR over the next several days.
kharai-tor commentedon Sep 16, 2021
Hi @carlossanlop I tested positive for covid and won't be able to get any work done for some time. If you guys need this taken care of urgently, please unassign me from the issue, otherwise I'll get back to it once I'm better.
I apologize for the inconvenience.
kharai-tor commentedon Oct 3, 2021
Hi @carlossanlop I'm back at it. I see a lot has changed in the repo since I first sent that PR(which is to be expected for a 3 year gap). Originally I added the analyzer source file to the
Microsoft.NetCore.Analyzersproject. That project is no longer there but I found something similar, I'm thinking theMicrosoft.CodeAnalysis.NetAnalyzersproject ->Microsoft.NetCore.Analyzers.Runtimefolder is the right place for it. Would you agree?Also I'm thinking of dropping this current PR and creating a new one instead. Doing a merge after this long is proving to be too much of a headache.
tarekgh commentedon Jan 12, 2022
@carlossanlop @buyaa-n could you please help with @TKharaishvili question in the previous comment?
@TKharaishvili are you still willing to submit the PR? Thanks!
buyaa-n commentedon Jan 13, 2022
Sorry for late reply @TKharaishvili @tarekgh
Yes that is the right place
Right, sounds good, feel free to close your old PR then
kharai-tor commentedon Jan 13, 2022
@tarekgh @buyaa-n I already proceeded since there was no response for a while. Decided to update the existing PR, it currently has the analyzer in it and I believe it was looked at by some of the team members. All that's missing right now is a fixer. I'll resume working on that next week.
danmoseley commentedon Apr 13, 2022
@TKharaishvili hello, are you still working on this ?
kharai-tor commentedon Apr 13, 2022
@danmoseley I pushed the latest code review requested changes yesterday. Waiting for another round of review now.