Created
March 20, 2019 07:28
-
-
Save sm-g/9718bac5972654e501a7be5c6f378b56 to your computer and use it in GitHub Desktop.
C# editorconfig naming rules checker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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