Warning: strpos(): needle is not a string or an integer in /customers/a/f/c/fjorden.se/httpd.www/joel/index.php on line 31
Warning: strpos(): needle is not a string or an integer in /customers/a/f/c/fjorden.se/httpd.www/joel/index.php on line 37
Warning: strpos(): needle is not a string or an integer in /customers/a/f/c/fjorden.se/httpd.www/joel/index.php on line 49

Blog by Joel Fjordén a.k.a. Will o Wisp - More Rules to Come

Blog by Joel Fjordén a.k.a. Will o Wisp

More Rules to Come

Sunday, July 15, 2007, 12:54 PM - Code Style Enforcer

Right now I’m working on extending the code rule architecture, making it possible to add name rules to more code types. The upcoming version, which probably will be released the next week, will first of all include new name rules for enumerations, enumeration values, exceptions, attributes and delegates. It will also be possible to specify different visibility rules for those. Suffix has also been added for each name rule, in the same way prefix works.

Besides from more rules for new code types, it will be possible to combine code types with visibility and keyword. Different name rules for public fields and private fields, for example, are therefore supported. The keywords, e.g. static, abstract, virtual and sealed makes it possible to add different name rules for static classes and instance classes, or different visibility rules for that matter. This will of course take some more time to implement, but the work has already begun. My guess is that it will be released sometime in week 33, since I’m now on vacation and will be going to New York for two weeks.

I hope you’ll like this extra granularity when it comes to rules, since a lot of you have requested it.

Well, I finally got some more time over to see over how the global and local rules are handled in Code Style Enforcer. First of all in the global Configurator application it's now possible to specify a location for the global rules. The default rules, shipped with CSE, are now located in a separate folder, thus always making it possible to revert any changes.

Creating/opening a solution in Visual Studio brings up a dialog where it's possible to select whether to link in the global rules or to add them as local rules in the solution. At the same time it’s possible to select whether to activate Code Style Enforcer for the solution or not. The choices made here are now remembered the next time the solution is opened, I know, pretty revolutionary :).

If selecting "No" on the question to activate Code Style Enforcer, and you later change your mind, it’s still possible to activate CSE through the Context Menu on the Solution. This will bring up the same CSE dialog again making it possible to select global or local rules.

I hope a lot of you will be satisfied with this solution, since it now supports the best from both worlds, i.e. global or local rules for a solution. I have some minor testing to do before releasing this new version, but I will put it up here within a few days!

I am now releasing a new minor version of Code Style Enforcer, where a fix has been made for an unfortunate bug in DXCore 2.2.2, which made Code Style Enforcer report invalid rule violations.

Besides this bug fix, there are some improvements coming from DXCore 2.2.2, namely experimental support for Visual Studio Codename "Orcas" and improved performance of the C# parser by approximately 30%.