Indentation

Content and general development discussion, including quest scripts and server code. TMW Classic is a project comprising the Legacy tmwAthena server & the designated improved engine server based on evolHercules.


Forum rules

This forum houses many years of development, tracing back to some of the earliest posts that exist on the board.

Its current use is for the continued development of the server and game it has always served: TMW Classic.

Post Reply
imorgado
Novice
Novice
Posts: 62
Joined: 22 Jan 2005, 20:50
Location: Rio de Janeiro - Brazil
Contact:

Indentation

Post by imorgado »

For all, I found that this is a good group of options for TMW indentation.

indent -npsl -bad -bap -fc1 -sc -br -ce -cdw -cli4 -cbi0 -npcs -di16 -nbc -brs -lp -ip4 -ppi3 -l79 -lc79 -nbbo -hnl -ts4 -nut CODENAME.cpp

Please do it before CVS upload. And review your code after this.

(comments to my options and enhancements are WELCOME)
User avatar
Bjørn
Manasource
Manasource
Posts: 1438
Joined: 09 Dec 2004, 18:50
Location: North Rhine-Westphalia, Germany
Contact:

Post by Bjørn »

We have indentation guidelines in docs/HACKING.txt. Basically we have agreed on using no tabs, but 4 spaces to indent. I don't like some of the aligning and spacing settings of your indent call above, and in my opinion we really don't need this tool.
imorgado
Novice
Novice
Posts: 62
Joined: 22 Jan 2005, 20:50
Location: Rio de Janeiro - Brazil
Contact:

Post by imorgado »

If there is something above that disagree with TMW develop team, please tell me. That configuration was done to resamble with TMW coding style.

I didn't like to use spaces instead tabs. And 4 spaces per indentation. But I will use it anyway.
User avatar
Bjørn
Manasource
Manasource
Posts: 1438
Joined: 09 Dec 2004, 18:50
Location: North Rhine-Westphalia, Germany
Contact:

Post by Bjørn »

Code: Select all

extern unsigned char screen_mode;
int             fps = 0, frame = 0, current_npc = 0;
bool            displayPathToMouse = false;
  
OkDialog       *deathNotice = NULL; 
  
#define MAX_TIME 10000
  
class           DeatchNoticeListener:public gcn::ActionListener {
public:
The aligning done above is not how we write our code, I think it creates strange amounts of whitespace (so no -di16). Also, we indent "public:" by 4 spaces, similar to "case 4:" in switch statements. Lastly, as I pointed out, we use 4 spaces for indent and not 2, like your statement above seems to do (needs -i4).

We are flexible in our placement of the "{" after the if statement, while your command above seems to force them to be on the same line.

I don't like the "-ppi3".

I haven't looked through everything yet, and I think it still needs some changes, but here's a slightly improved paramter list that matches better the current TMW code:

indent -npsl -bad -bap -fc1 -sc -bl -nce -ncdw -cli4 -cbi0 -bli0 -npcs -nbc -brs -lp -ip4 -l79 -lc79 -nbbo -hnl -i4 -ts8 -nut file.cpp

Still, this tool doesn't use common sense, so I still don't agree to use it.
Post Reply