Don't offer to fix naming for record parameters #47509
Don't offer to fix naming for record parameters #47509davidwengier merged 5 commits intodotnet:masterfrom
Conversation
08eb631 to
9f26443
Compare
Youssef1313
left a comment
There was a problem hiding this comment.
Does this completely ignore positional parameters and never offers a diagnostic for?
I think it's useful to have a diagnostic for violating the naming convention, just don't offer "cyclic" diagnostics/codefixes.
|
It still offers a diagnostic, and therefore fixer, for when they violate property naming conventions, and there is a test for it too :) |
|
We should def discuss this. We need a general team agreement on how to treat the dual prop/param nature of records. Tagging @jcouv as well |
|
I was looking in general at records issues (posted something in Teams too) and I feel pretty strongly that the parameters and properties should be considered in the same way for records, but happy to discuss. At the moment support is inconsistent and there are some sharp edges. |
src/Analyzers/CSharp/Analyzers/NamingStyle/CSharpNamingStyleDiagnosticAnalyzer.cs
Outdated
Show resolved
Hide resolved
src/Analyzers/Core/Analyzers/NamingStyle/NamingStyleDiagnosticAnalyzerBase.cs
Outdated
Show resolved
Hide resolved
|
Thanks @sharwell, fixed that issue. Records are so nice to use as a single line declaration, I forget its legal for them to be any bigger :) |
f051a67 to
c8f78c8
Compare
Fixes #47508
Not sure if this is a controversial opinion that needs to go to a design meeting first, or not, but its a long weekend in the US. Worst case this gets closed ¯\_(ツ)_/¯