Re: Re: Experimenting with GNU indent

Hi Sebastien,

Thanks for the info! I downloaded the eclipse plugin version (jalopy-eclipse-0.2-1.5rc3.zip) and unpacked the archive in my eclipse/plugin directory. I’m not an Eclipse expert but I think that’s the way installing works there ;-). Anyway, I can’t find Jalopy nowhere in the menus, neither it’s listed under Help->Software Updates->Manage Configuration. Could you please give me some install hints (I did a quick search on the Internet but couldn’t find any “real” instructions) but the documentation seems to be very poor?

Have you used Jalopy to beautify the Calitko source? As far as I saw on their website, there is also a console version of Jalopy, which will be very useful for running batches.

Regards,

Peter

sebastien venot wrote:Hi,

Under eclipse i am using Jalopy to automatically format my code the way i want. You can follow SUN java code style, GNU style, C style or make your own style:

http://jalopy.sourceforge.net/

But of course this is a solution for Eclipse user only. I am not sure if jalopy can be used on command line or without eclipse.

regards

seb

Peter Dimov wrote:

Hello everybody,

I finally spent some hours today to go through all configuration options of GNU indent and experiment on our Gnutella Packet.h and Packet.cpp. The closest I could ever get was with this:

$ indent Packet.h -o Packet.o.h -bad -bap -br -ce -cdw -cli0 -cbi4 -ss -pcs -cs -bs -saf -sai -saw -nprs -bls -fc1 -i4 -lp -ts4 -di24 -l80 -sbi0 -sob -ut -c0 -cd0 -cp0 -nfca

The result is not really satisfying. indent even breaks the code at some places. For example the definitions of const member functions get a second const and that’s wrong. I also have trouble indenting variable declarations because function definitions are affected as well and some other statements where that’s not desired. There is a lack of options for C++ syntax. For example, no option to say where you want the opening bracket of a namespace and whether you want indentation of its block, no control for indentation of public:, protected: and private:, etc. It is actually said in the documentation that there might be problems with C++ code.

It’s not all bad though. Braking long argument lists and conditionals is great! Whitespaces around keywords, function names, parentheses are done fine. Maybe I should try out whether it is possible to use only the features that “work” on the source of Calitko and have the rest done by some other tool or by hand. That will be better than having nothing at all!

I’m open to any suggestions!

Regards,

Peter

Would you like to post a relpy?


This post is a reply to:
Re: Experimenting with GNU indent
Hi, Under eclipse i am using Jalopy to automatically format my code the way i want. You can follow SUN java code style, GNU style, C style or make your own (more...)

No follow-ups yet.