Skip to content

Instantly share code, notes, and snippets.

@sm-g
Created March 20, 2019 07:28
Show Gist options
  • Save sm-g/9718bac5972654e501a7be5c6f378b56 to your computer and use it in GitHub Desktop.
Save sm-g/9718bac5972654e501a7be5c6f378b56 to your computer and use it in GitHub Desktop.
C# editorconfig naming rules checker
public class NamingRulesChecker
{
private const string PrivateConst = " ";
private static readonly double PrivateStaticReadonlyLikeConstant = TimeSpan.FromSeconds(3).Ticks;
private static readonly string[] _privateStaticReadonlyOthers = new[] { "None" };
private static string _privateStatic = "";
public const string PublicConst = "";
public static string PublicStatic = "";
private string _privateInstance;
public string PublicInstance;
// protected fields should not be used
private void Member(string paraMeter)
{
const string LocalConst = "";
var localVar = paraMeter;
_privateStatic = string.Empty;
LocalFunction();
void LocalFunction()
{
_privateInstance = LocalConst;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment