Restrict user to commit non standards code


We would like to know is there any plugin/service to restrict the user to commit their changes without maintaining some basic standards like static variables must be declared with capital letters (public static string STR = ‘somestring’ in this case the code should be pushed to the repo, but if developer types public static string str = ‘somestring’, he should not able to commit his changes to repo, because he is using small str to declare static variables)

Thanks in advance.