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
Brief description: My team prefers using consts for literals that are assigned upon declaration and not re-assigned. I'm sure there are other teams that'd agree, but I'm curious if there's an analyzer for this. If not, can we add one?
Languages applicable:
Is your analyzer C# only? VB Only? Or Both? - Both
Code example that the analyzer should report:
// beforeprivatevoidPrintHelpText(){varhelpText="This is how you do it.";// flag this variable because it's assigned upon declaration, not re-assignedConsole.Write(helpText);}
could be updated to
// afterprivatevoidPrintHelpText(){conststringhelpText="This is how you do it.";Console.Write(helpText);}
Brief description: My team prefers using
const
s for literals that are assigned upon declaration and not re-assigned. I'm sure there are other teams that'd agree, but I'm curious if there's an analyzer for this. If not, can we add one?Languages applicable:
Is your analyzer C# only? VB Only? Or Both? - Both
Code example that the analyzer should report:
could be updated to
Documentation requirements:
When this analyzer is implemented, it must be documented by following the steps at Documentation for IDE CodeStyle analyzers.
The text was updated successfully, but these errors were encountered: