Author |
Message
|
logonaniket |
Posted: Wed Jul 08, 2015 12:00 am Post subject: Is there any ESQL beautifier? |
|
|
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 |
|
 |
akidase |
Posted: Wed Jul 08, 2015 2:04 am Post subject: |
|
|
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 |
|
 |
logonaniket |
Posted: Wed Jul 08, 2015 2:27 am Post subject: |
|
|
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 |
|
 |
McueMart |
Posted: Wed Jul 08, 2015 4:18 am Post subject: |
|
|
 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 |
|
 |
mqjeff |
Posted: Wed Jul 08, 2015 4:37 am Post subject: |
|
|
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 |
|
 |
logonaniket |
Posted: Thu Jul 09, 2015 2:30 am Post subject: |
|
|
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 |
|
 |
mqjeff |
Posted: Thu Jul 09, 2015 5:05 am Post subject: |
|
|
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 |
|
 |
kimbert |
Posted: Thu Jul 09, 2015 6:25 am Post subject: ' |
|
|
 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 |
|
 |
mqjeff |
Posted: Thu Jul 09, 2015 6:28 am Post subject: |
|
|
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 |
|
 |
Vitor |
Posted: Thu Jul 09, 2015 6:29 am Post subject: Re: ' |
|
|
 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 |
|
 |
kimbert |
Posted: Thu Jul 09, 2015 2:48 pm Post subject: |
|
|
 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 |
|
 |
Vitor |
Posted: Fri Jul 10, 2015 4:12 am Post subject: |
|
|
 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 |
|
 |
|