narrange-users Mailing List for NArrange - .NET Code Organizer/Formatter
Status: Beta
Brought to you by:
jamesnies
You can subscribe to this list here.
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(3) |
Jul
(2) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
---|
From: <ja...@na...> - 2008-08-11 07:52:00
|
Version 0.2.7 of NArrange has just been released, which features a default configuration that is compatible with the Microsoft StyleCop member ordering rules. If you haven't yet tried out StyleCop, I highly suggest taking a look at it. It provides fine grain style source analysis and covers many areas outside the scope of NArrange. However, it only reports style violations and does not fix them. This is where NArrange comes in to make quick work of formatting your source code to match the ordering rules. As this is the first NArrange release with StyleCop compatibility, please report any issues to the SourceForge bug tracker. Also, if you'd like to continue using the old NArrange default configuration, DefaultConfig.v026.xml has been added to the distribution. Thanks, James Nies ja...@na... NArrange - .NET Code Organizer -------- Original Message -------- Subject: [Narrange-users] NArrange with StyleCop Compatibility Feedback From: ja...@na... Date: Sat, July 26, 2008 8:26 pm To: nar...@li... Hello all, I'm nearing completion of a version of NArrange that features a StyleCop compatible default configuration (well, for the most part -- read on). As part of this, support for moving using directives within namespaces will be added. If anyone is interested in trying out a private build prior to release, I would greatly appreciate the feedback. This is your chance to help define the new default configuration for NArrange. One particular area where I'm interested in feedback is default region names for methods, properties etc. and how they are grouped. A couple variations can be used that would still provide compatibility with StyleCop rules. For instance, what I have right now would arrange methods as follows: #region Public Static Methods <public static methods sorted by name> #endregion Public Static Methods #region Public Methods <public methods sorted by name #endregion Public Methods #region Internal Static Methods <internal static methods sorted by name> #endregion Internal Static Methods #region Internal Methods <internal methods sorted by name> #endregion Internal Methods ... and so on by accessibility. However, it may be less verbose and cleaner to omit accessibility from the regions and have something like: #region Methods <public static methods sorted by name> <public methods sorted by name> <internal static methods sorted by name> <internal methods sorted by name> ... #endregion Methods I plan on still having regions on by default, but the prior release of NArrange supports disabling all region directives. One particular StyleCop rule I find troubling is that fields must be sorted by const/readonly then accessibility. However, this creates a problem if you have multiple static fields that reference each other with different accessibility. For instance, say you had a private static field that was referenced in a public static field. If the public static field was initialized in-line, this could cause a problem. Here is an example: private static int _version = 10; public static readonly string Version = _version.ToString(); As is, the above value for Version would be "10", what you would expect. However, by switching the order of the above lines to match the rules defined by StyleCop the behavior of the Version field would be incorrect and return "0". This is due to _version not being assigned at the time that Version is initialized. I haven't yet decided, but this seems like an issue with StyleCop or at least that it should support ignoring of violations in this scenario. It doesn't appear that StyleCop supports disabling accessibility ordering just for fields. It is for this reason that previous versions of NArrange preserve ordering of static fields by default. I'm thinking that it would be ideal to keep this behavior in the upcoming version of the tool. NArrange has been designed so as to not alter the semantics of code. Applying ordering rules to static fields seems dangerous, but I would be interested in everyone's feedback. The downside to not altering the order of static fields is that you of course would have several rules broken and would not be able to treat them as errors in your development process. I'd suggest against manually fixing the violations after NArrange-ing as you'd have to do this every time the tool was run. I guess you could also disable the accessibility and constant/readonly ordering StyleCop rules altogether, since NArrange would automatically be enforcing ordering for everything but fields, but I'd like to find a better way. As is now, I have 3 StyleCop violations related to fields in the NArrange codebase, down from a total had previously been in the thousands. However, this did take a lot of manual work for adding doc comments and fixing up parameter lists that spanned multiple lines. Thanks everyone for joining the list and I look forward to your feedback. James Nies ja...@na... NArrange - .NET Code Organizer ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Narrange-users mailing list Nar...@li... https://lists.sourceforge.net/lists/listinfo/narrange-users |
From: <ja...@na...> - 2008-07-27 03:26:08
|
Hello all, I'm nearing completion of a version of NArrange that features a StyleCop compatible default configuration (well, for the most part -- read on). As part of this, support for moving using directives within namespaces will be added. If anyone is interested in trying out a private build prior to release, I would greatly appreciate the feedback. This is your chance to help define the new default configuration for NArrange. One particular area where I'm interested in feedback is default region names for methods, properties etc. and how they are grouped. A couple variations can be used that would still provide compatibility with StyleCop rules. For instance, what I have right now would arrange methods as follows: #region Public Static Methods <public static methods sorted by name> #endregion Public Static Methods #region Public Methods <public methods sorted by name #endregion Public Methods #region Internal Static Methods <internal static methods sorted by name> #endregion Internal Static Methods #region Internal Methods <internal methods sorted by name> #endregion Internal Methods ... and so on by accessibility. However, it may be less verbose and cleaner to omit accessibility from the regions and have something like: #region Methods <public static methods sorted by name> <public methods sorted by name> <internal static methods sorted by name> <internal methods sorted by name> ... #endregion Methods I plan on still having regions on by default, but the prior release of NArrange supports disabling all region directives. One particular StyleCop rule I find troubling is that fields must be sorted by const/readonly then accessibility. However, this creates a problem if you have multiple static fields that reference each other with different accessibility. For instance, say you had a private static field that was referenced in a public static field. If the public static field was initialized in-line, this could cause a problem. Here is an example: private static int _version = 10; public static readonly string Version = _version.ToString(); As is, the above value for Version would be "10", what you would expect. However, by switching the order of the above lines to match the rules defined by StyleCop the behavior of the Version field would be incorrect and return "0". This is due to _version not being assigned at the time that Version is initialized. I haven't yet decided, but this seems like an issue with StyleCop or at least that it should support ignoring of violations in this scenario. It doesn't appear that StyleCop supports disabling accessibility ordering just for fields. It is for this reason that previous versions of NArrange preserve ordering of static fields by default. I'm thinking that it would be ideal to keep this behavior in the upcoming version of the tool. NArrange has been designed so as to not alter the semantics of code. Applying ordering rules to static fields seems dangerous, but I would be interested in everyone's feedback. The downside to not altering the order of static fields is that you of course would have several rules broken and would not be able to treat them as errors in your development process. I'd suggest against manually fixing the violations after NArrange-ing as you'd have to do this every time the tool was run. I guess you could also disable the accessibility and constant/readonly ordering StyleCop rules altogether, since NArrange would automatically be enforcing ordering for everything but fields, but I'd like to find a better way. As is now, I have 3 StyleCop violations related to fields in the NArrange codebase, down from a total had previously been in the thousands. However, this did take a lot of manual work for adding doc comments and fixing up parameter lists that spanned multiple lines. Thanks everyone for joining the list and I look forward to your feedback. James Nies ja...@na... NArrange - .NET Code Organizer |
From: <ja...@na...> - 2008-07-11 07:08:05
|
<!-- wmLetter_head_start --> <table align="center" style="empty-cells: show;" bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td style="vertical-align: top;"><div style="padding: 5px"><!-- wmLetter_head_end --><html><body><div>Version 0.2.6 has just been released. The following changes were made in this release:</div> <div> </div> <div>- Allow region directives to be written as comments. You can also now write regions without directives (i.e. as groups).<BR>- Fixed a bug where in certain scenarios, the text of commented out elements was being reversed.<BR>- Fixed parsing of nullable type references containing whitespace.<BR>- Fixed an issue parsing escaped strings in C# member bodies.</div> <div> </div> <div>Note: If you're interested in having regions being written with custom start/end comments, I recommend reading over the Regions formatting secton in the docs. There are a couple caveats that could cause you trouble when changing the format for comment directives.</div> <div> </div> <div>Thanks,</div> <div> </div> <div>James Nies</div> <div><A href="mailto:ja...@na..." mce_href="mailto:ja...@na..."><a href="mailto:ja...@na...">ja...@na...</a></A></div> <div> </div> <div>NArrange - .NET Code Organizer</div></body></html><!-- wmLetter_tail_start --></div></td></tr><tr><td style="text-align: left;" align="left" height="30" colspan="1"><img src="cid:bottom@0bbf243beed3bf849192c2af50d4bbb4"></td></tr></table><!-- wmLetter_tail_end --> |
From: <ja...@na...> - 2008-06-23 07:41:31
|
<!-- wmLetter_head_start --> <table align="center" style="empty-cells: show;" bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td style="vertical-align: top;"><div style="padding: 5px"><!-- wmLetter_head_end --><html><body><div>Justin,</div> <div> </div> <div>Sorry for the delayed response, I've been traveling this weekend with little connectivity. </div> <div> </div> <div>Yes, I've been meaning to address installation but wasn't sure how much benefit it would add yet without an IDE add-in. However, I'd gladly accept any help in the setup department as I've gotten more feature requests lately than I can keep up with on my own. For the installer, it would be nice if WIX could be used, but that's only because I'm experienced with it. The patch you sent, is that using the Nullsoft Installer? If so, I'll have to learn more about it and how it compares with WIX. Are there any resources you would recommend?</div> <div> </div> <div>I guess the one drawback to an installer for the external tool(s) is that a default command line parameter for the item/project/solution path has to be chosen. Item path would probably be best suitable as a default for most users. </div> <div> </div> <div>Since NArrange doesn't target any one particular IDE, it would be nice to maintain the ability to build the solution with VS/VS Express/SharpDevelop/MonoDevelop.</div> <div> </div> <div>A SharpDevelop add-in is currently on the backlog of features, but I haven't yet had a chance to look into this. I've got a basic start on a VS add-in, but I've pushed the priority on this for some other features that had numerous requests (e.g. handling preprocessor directives and preserving user-defined regions). For all IDE's, it would be ideal if the add-ins had identical functionality, but I haven't yet defined all the functionality for the VS add-in.<BR></div> <div>Anyway, I'll try to get a chance to apply your patch and run the installer this week. Also, I'll set up a developer mailing list that may be more appropriate for these types of discussions.</div> <div> </div> <div>Thanks for the feedback and your interest in the project,</div> <div> </div> <div> </div> <div>James Nies</div> <div><A href="mailto:ja...@na..." mce_href="mailto:ja...@na..."><a href="mailto:ja...@na...">ja...@na...</a></A></div> <div> </div> <P>NArrange - .NET Code Organizer<BR><BR> <BLOCKQUOTE style="PADDING-LEFT: 8px; MARGIN-LEFT: 8px; BORDER-LEFT: blue 2px solid" webmail="1">-------- Original Message --------<BR>Subject: [Narrange-users] Narrange<BR>From: "Justin Dearing" <ZIPPY1981@<FONT class=mceItemHiddenSpellWord>gmail</FONT>.com><BR>Date: Sat, June 21, 2008 10:01 am<BR>To: <a href="mailto:nar...@li...">nar...@li...</a><BR><BR>James,<BR><BR>You have a lovely tool here. May I make a few suggestions:<BR><BR>1) Would you accept an installer into the repo if I wrote one? It<BR>would add external tools to the menu by writing to the registry<BR>2) You might want to consider using SharpDevelop<BR>(<A href="http://www.icsharpcode.net/OpenSource/SD/" target=_blank mce_href="http://www.icsharpcode.net/OpenSource/SD/"><a href="http://www.icsharpcode.net/OpenSource/SD/">http://www.icsharpcode.net/OpenSource/SD/</a></A>) instead of Visual Studio<BR>express for developing the tool. It allows you run your NUnit tests<BR>from inside the IDE, and will allow you to include projects of<BR>multiple languages in one solution. Having an actual <a href="http://VB.NET">VB.NET</a> project to<BR>test against might be useful for unit tests. Your current solution<BR>open just fine in SharpDevelop.<BR>3) I would like to remove all the unused "using" statements from your<BR>code. I can do this automatically via SharpDevelop or the Resharper<BR>addin for Visual Studio and send you a patch.<BR>4) Your tool is CPL so it cannot be included in SharpDevelop core.<BR>However, since SharpDevelop is LGPL someone could write an NArrange<BR>addin for sharpdevelop that you could distribute on your SF project.<BR><BR>Disclaimer, I contribute to SharpDevelop.<BR><BR>Regards,<BR><BR>Justin Dearing<BR><BR>-------------------------------------------------------------------------<BR>Check out the new <a href="http://SourceForge.net">SourceForge.net</a> Marketplace.<BR>It's the best place to buy or sell services for<BR>just about anything Open Source.<BR><A href="http://sourceforge.net/services/buy/index.php" target=_blank mce_href="http://sourceforge.net/services/buy/index.php"><a href="http://sourceforge.net/services/buy/index.php">http://sourceforge.net/services/buy/index.php</a></A><BR>_______________________________________________<BR>Narrange-users mailing list<BR><A onclick="Popup.composeWindow('pcompose.php?sendto=Narrange-users%40lists.sourceforge.net'); return false;" href="http://email.secureserver.net/pcompose.php#Compose" mce_href="http://email.secureserver.net/pcompose.php#Compose">Narrange-users<B></B>@lists.sourceforge.net</A><BR><A href="https://lists.sourceforge.net/lists/listinfo/narrange-users" target=_blank mce_href="https://lists.sourceforge.net/lists/listinfo/narrange-users"><a href="https://lists.sourceforge.net/lists/listinfo/narrange-users">https://lists.sourceforge.net/lists/listinfo/narrange-users</a></A><BR></BLOCKQUOTE></body></html><!-- wmLetter_tail_start --></div></td></tr><tr><td style="text-align: left;" align="left" height="30" colspan="1"><img src="cid:bottom@df10fba45d9834e88b4eae892dd6eca9"></td></tr></table><!-- wmLetter_tail_end --> |
From: Justin D. <zip...@gm...> - 2008-06-22 21:07:04
|
James, Beginnings of an installer script. I will work on it some more. For the External tool thing to work with the express editions you need to populate dffferent registry keys. VB 2008 express is HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VBExpress\9.0\External Tools\NArrange I don't know what CSharp is. I will find out soon. On Sat, Jun 21, 2008 at 1:01 PM, Justin Dearing <zip...@gm...> wrote: > James, > > You have a lovely tool here. May I make a few suggestions: > > 1) Would you accept an installer into the repo if I wrote one? It > would add external tools to the menu by writing to the registry > 2) You might want to consider using SharpDevelop > (http://www.icsharpcode.net/OpenSource/SD/) instead of Visual Studio > express for developing the tool. It allows you run your NUnit tests > from inside the IDE, and will allow you to include projects of > multiple languages in one solution. Having an actual VB.NET project to > test against might be useful for unit tests. Your current solution > open just fine in SharpDevelop. > 3) I would like to remove all the unused "using" statements from your > code. I can do this automatically via SharpDevelop or the Resharper > addin for Visual Studio and send you a patch. > 4) Your tool is CPL so it cannot be included in SharpDevelop core. > However, since SharpDevelop is LGPL someone could write an NArrange > addin for sharpdevelop that you could distribute on your SF project. > > Disclaimer, I contribute to SharpDevelop. > > Regards, > > Justin Dearing > |
From: Justin D. <zip...@gm...> - 2008-06-21 18:48:47
|
James, You have a lovely tool here. May I make a few suggestions: 1) Would you accept an installer into the repo if I wrote one? It would add external tools to the menu by writing to the registry 2) You might want to consider using SharpDevelop (http://www.icsharpcode.net/OpenSource/SD/) instead of Visual Studio express for developing the tool. It allows you run your NUnit tests from inside the IDE, and will allow you to include projects of multiple languages in one solution. Having an actual VB.NET project to test against might be useful for unit tests. Your current solution open just fine in SharpDevelop. 3) I would like to remove all the unused "using" statements from your code. I can do this automatically via SharpDevelop or the Resharper addin for Visual Studio and send you a patch. 4) Your tool is CPL so it cannot be included in SharpDevelop core. However, since SharpDevelop is LGPL someone could write an NArrange addin for sharpdevelop that you could distribute on your SF project. Disclaimer, I contribute to SharpDevelop. Regards, Justin Dearing |