ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Is there any ESQL beautifier?

Post new topic  Reply to topic
 Is there any ESQL beautifier? « View previous topic :: View next topic » 
Author Message
logonaniket
PostPosted: Wed Jul 08, 2015 12:00 am    Post subject: Is there any ESQL beautifier? Reply with quote

Novice

Joined: 12 Dec 2013
Posts: 17

Hi Guys

I have lots of junk code in my company which was developed way back in 2007 and have just been commented out and not removed. Over the period of time, the code has become HUGE (more than 10000 lines) and now it is difficult to even traverse and do the code cleaning.

Is there any code beautifier or formatter available for ESQL?
Back to top
View user's profile Send private message
akidase
PostPosted: Wed Jul 08, 2015 2:04 am    Post subject: Reply with quote

Centurion

Joined: 10 Jan 2011
Posts: 124

Code:
find . -name "*.esql*" -exec sed -i '/filePath/d' {} \;
- will remove all lines containing filePath. - Unix after placing your code in FileSystem.

Same thing you could do for string as "--" , so you identify comments and then have to use a version control system to see which you can check-in or out.

Hope this helps.
Back to top
View user's profile Send private message
logonaniket
PostPosted: Wed Jul 08, 2015 2:27 am    Post subject: Reply with quote

Novice

Joined: 12 Dec 2013
Posts: 17

That is not what I am looking for I am looking for a tool which can do fix the indentation,loops, if/endif and basically everything what jacobe (java beautifier) does...

akidase wrote:
Code:
find . -name "*.esql*" -exec sed -i '/filePath/d' {} \;
- will remove all lines containing filePath. - Unix after placing your code in FileSystem.

Same thing you could do for string as "--" , so you identify comments and then have to use a version control system to see which you can check-in or out.

Hope this helps.
Back to top
View user's profile Send private message
McueMart
PostPosted: Wed Jul 08, 2015 4:18 am    Post subject: Reply with quote

Chevalier

Joined: 29 Nov 2011
Posts: 490
Location: UK...somewhere

The toolkit has 'Format' functionality for ESQL (Ctrl+Shift+F).

I dont actually use it much myself, and from a quick test, it is less than perfect!
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Jul 08, 2015 4:37 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Also remember that all ESQL files in the same broker schemas are inlined together - treated as one file at deploy time.

So if you have very large single ESQL files, you can move routines into new files without affecting the execution of the code.

Toolkit Format is the only thing that will fix the things you want, other than writing your own ESQL parser....
Back to top
View user's profile Send private message
logonaniket
PostPosted: Thu Jul 09, 2015 2:30 am    Post subject: Reply with quote

Novice

Joined: 12 Dec 2013
Posts: 17

Thanks all..

I already knew Ctrl+Shift+F but it doesn't work like java beautifiers and xml beautifiers. Seem I have to wait till someone writes something like this...
Back to top
View user's profile Send private message
mqjeff
PostPosted: Thu Jul 09, 2015 5:05 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

logonaniket wrote:
Thanks all..

I already knew Ctrl+Shift+F but it doesn't work like java beautifiers and xml beautifiers. Seem I have to wait till someone writes something like this...


What are you looking for that it doesn't do?
Back to top
View user's profile Send private message
kimbert
PostPosted: Thu Jul 09, 2015 6:25 am    Post subject: ' Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
I have lots of junk code in my company which was developed way back in 2007 and have just been commented out and not removed. Over the period of time, the code has become HUGE (more than 10000 lines) and now it is difficult to even traverse and do the code cleaning.

To summarize:
- the code contains a lot of 'junk'
- the code is badly structured
- the code needs to be cleaned up

You need a decent text editor ( Notepad++ or better ) and a lot of time. If you think that Ctrl-a, Beautify will solve all of your problems then you are seriously underestimating your problems.

I agree, though, that the whole ESQL editing experience could be made a *lot* better.
_________________
Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Thu Jul 09, 2015 6:28 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

in terms of removing comments, you can use regexs for this. delete (or move to another file via redirection) any lines that start with -- or any set of lines that are enclosed by /* and */
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu Jul 09, 2015 6:29 am    Post subject: Re: ' Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

kimbert wrote:
I agree, though, that the whole ESQL editing experience could be made a *lot* better.


Have you seen the GDM in v10?

They're coming for us coders. I hear the marching feet......
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
kimbert
PostPosted: Thu Jul 09, 2015 2:48 pm    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
Have you seen the GDM in v10?
Yes, once or twice...
Are you saying that it's an example of a great editing experience, or that it makes the ESQL editing experience look good? (*ducks*)
_________________
Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too.
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Jul 10, 2015 4:12 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

kimbert wrote:
or that it makes the ESQL editing experience look good? (*ducks*)


If you need a safe place to hide from a restless lynch mob of IBM developers with torches and a small portable gallows, I can suggest some good spots locally.

I was indicating that the new GDM goes a long way towards removing the need for code, and certainly the long screeds of code once needed within the product.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Is there any ESQL beautifier?
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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.