SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Query on reformatting of code - picking up developer details

 
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant View previous topic
View next topic
Query on reformatting of code - picking up developer details
Author Message
Mark Williams



Joined: 30 Jun 2011
Posts: 17
Country: United Kingdom

Post Query on reformatting of code - picking up developer details Reply with quote
Hi,

Liking the formatting tool. We are looking to incorporate code reformatting as part of our code review process. There is nothing worse than - or more time consuming than untidy code.

So our company, as part of the coding process, will insist that code if formatted to the same set of SA rules across all devs.

You can obviously change the rule templates for code formatting and formatted code has a header comment '* Code formatted by SoftTree...' at the top. This includes useful information such as Date and Time. OK - nothing new to you from my post so far.

My question: Is there any way that I can use (I believe they are called) macro variables to trap who formatted the code - kind of like $LOGIN$ or $USER$ - within the header comment? The gain here is that the header shows that a specific developer formatted the code at a specific time and date.

It might seem overkill - but I'm being asked for it.. :/

thanks in advance. :)
Fri Sep 14, 2012 8:53 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 6502

Post Reply with quote
I'm not sure the code formatting can use dynamic macro variables like the code generator, code refactoring functions, and code snipepts. I've played with it for a little while and it seems to understand only 3 simple macros $DATE$, $TIME$ and $SA_VERSION$, it didn't recognize anything else. I tried the built in $OSUSER$ and $USER$ and they didn't work for me.

So I would think the only solution for now is having each developer to customize the "(header)" rule in the settings and replace the preconfigured text with something like

Code:
/************************************************************
 * Code formatted by Name-Goes-Here
 * Time: $DATE$ $TIME$
 ************************************************************/

Fri Sep 14, 2012 10:03 am View user's profile Send private message
Mark Williams



Joined: 30 Jun 2011
Posts: 17
Country: United Kingdom

Post Reply with quote
Thanks. I feared as much from my own investigations.

Thanks for your time.
Fri Sep 14, 2012 10:36 am View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 1397

Post Reply with quote
Though $USER$ and $LOGIN$ would be useless when formatting code offline, if that matters, I support the idea of having all the three available in header.
Fri Sep 14, 2012 2:33 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 6502

Post Reply with quote
There are existing $OS_USER$ and $USER$ which might be helpful in the code formatting when used within comments.
Fri Sep 14, 2012 2:43 pm View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 1397

Post Reply with quote
Yes, those are put to heavy use when creating objects like tables, stored procedures, functions, etc. but most of the ad-hoc codes never get commented even if they're re-used frequently. On the other hand, they're reformatted after each and every change made to them so these could help make this process become semi-automatic. I don't think this to be essential. After all, I'm the only one using SA here (I'm still trying to convince the management to buy more licences) so it's quite obvious if I've touched the code :) But it's a good candidate for a feature request.
Fri Sep 14, 2012 2:59 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 6502

Post Reply with quote
This feature has been implemented in the latest version 6.3. Please consider upgrading to that version.
Mon Nov 05, 2012 11:18 am View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.