Is there any “forbidden code patterns” example anywhere on the internet ?
Again, a new cool tool by Microsoft that has simply no use, the “forbidden code patterns”, is there any practical sample of how to write a single useful C# “forbidden code pattern”?
I can defiantly tell the tools not to accept any code that has the word “Hello World” in it, but that’s about it, ok, maybe a bit more.
I want any useful example, anything :-)
I want to see the example so I can write my own custom code patterns, I have a long list, and I still can’t implement it.
Maybe the tool is ok, maybe I am missing something or don’t have the experience, who know, let us see a sample, I am sure you tested that tool with something :-)
[1167 byte] By [
G.T.] at [2008-2-15]
Assuming you're talking about the checkin policy, the text you put in is a regular expression - for each of the pending changes where the path matches, that creates a policy failure.
You can see the original post with the policy @ http://blogs.msdn.com/jmanning/archive/2006/02/02/523125.aspx
An example would be \.sql$ for "ends with .sql" since 1) you need to escape the . in a regular expression so it doesn't mean "one of any character" and 2) $ means end-of-line (end-of-string in this case).
If you want to know about regular expressions, I would recommend:
Tool to use: Regular Expression Workbench @ http://blogs.msdn.com/ericgu/archive/2003/07/07/52362.aspx
Book: Mastering Regular Expressions @
http://www.oreilly.com/catalog/regex/