 |
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
Mark Williams
Joined: 30 Jun 2011 Posts: 17 Country: United Kingdom |
|
Query on reformatting of code - picking up developer details |
|
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 |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
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 formatted by Name-Goes-Here
* Time: $DATE$ $TIME$
************************************************************/ |
|
|
Fri Sep 14, 2012 10:03 am |
|
 |
Mark Williams
Joined: 30 Jun 2011 Posts: 17 Country: United Kingdom |
|
|
|
Thanks. I feared as much from my own investigations.
Thanks for your time.
|
|
Fri Sep 14, 2012 10:36 am |
|
 |
gemisigo
Joined: 11 Mar 2010 Posts: 2165
|
|
|
|
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 |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
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 |
|
 |
gemisigo
Joined: 11 Mar 2010 Posts: 2165
|
|
|
|
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 |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
This feature has been implemented in the latest version 6.3. Please consider upgrading to that version.
|
|
Mon Nov 05, 2012 11:18 am |
|
 |
|
|
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
|
|
|