amagnasco / xwpe

Upload of an abandoned ncurses-based programming environment
http://www.identicalsoftware.com/xwpe/
GNU General Public License v2.0
31 stars 7 forks source link

Formatting makes reading and understanding difficult #60

Closed gbonnema closed 7 years ago

gbonnema commented 7 years ago

The way the previous authors have formatted the code is often terse and no very easy on the eyes to see the blocks of code clearly. This is additional to the length of the functions.

I am planning doing an automatic reformat using indent. By default it formats gnu-style. Ofcourse if you prefer we could also use kr-style (Kernighan and Richie). Personally I am not sure which is better, but kr-style is definitely a bit more compact, without losing sight of the big picture.

Will wait with this one until I have the autotools merged into the experimental branch.

gbonnema commented 7 years ago

I now have the autotools merged and all warnings resolved except for fall through, which I only get locally. I want to do the reformatting source file by source file and see if it works. Will create a separate branch on my repo, as I did with autotools and warnings. As soon as I have this finished to my satisfaction, I will issue a new pull request (into experimental, like the last ones).

At any time, if you have queries let me know. Haven't heard from you in a while, so I don't know whether you are still following this.

EDIT: I now have astyle working with option for allman style : astyle --style=allman. I created a file .astylerc in my home directory and have as only line style=allman. From vim I use a plugin to do the astyle reformatting with every write (plugin is Chiel91/vim-autoformat using Vundle as plugin manager).

So for now this is solved and I will close the issue.

Kind regards, Guus.