Thursday, December 01, 2005

Simian IgnoreBlocks

Simian contains the feature ignoreBlocks. The documentation on the Simian website states that ignoreBlocks:
Ignores all lines between specified START/END markers
IgnoreBlocks is perfect for ignoring things such as the entire AssemblyInfo class or the Dispose method that is generated for each Form that Visual Studio creates.

To use ignoreBlocks add start and end markers to your code.
#region ignoreBlock - Dispose(bool disposing)
public void Dispose(bool disposing)
{
...
}
#endregion
Then add ignoreBlocks to your Simian configuration file.
-ignoreBlocks=#region ignoreBlock:#endregion
Simian should now be correctly configured to ignore all blocks of code in regions named ignoreBlock.

Documentation for ignoreBlocks is very limited. Here are a few things I learned along the way.
  • In version 2.2.7 and below ignoreBlocks does not work correctly with #regions in C#.
  • Simian ignores all comment lines; therefore, comments can not be used as start and or end markers.
  • If you use a configuration file do not add quotes around the start and end markers.
  • If you specify your options at the command line put quotes around the start and end markers. (i.e. -ignoreBlocks="#region ignoreBlock:#endregion")
  • Simon Harris is very responsive and kind. If you have any questions about Simian do not hesitate to contact him.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.