Code style for CodeLite

Discussion about CodeLite development process and patches
AJenbo
CodeLite Enthusiast
Posts: 41
Joined: Mon May 22, 2017 12:06 pm
Genuine User: Yes
IDE Question: C++
Contact:

Code style for CodeLite

Post by AJenbo » Sat Jun 03, 2017 1:51 pm

What code style should I use when developing on CL? I find that both clang and astyle by default change a lot about the code in various files when I enable CodeFormatter while developing on CodeLite it self.

User avatar
eranif
CodeLite Plugin
Posts: 5927
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Code style for CodeLite

Post by eranif » Sat Jun 03, 2017 3:39 pm

There is this wiki page I wrote a while back: http://codelite.org/Developers/CodingGuidelines

I will probably convert it into .editorconfig and will add it to git repo - this will force the coding guidelines (most of them...)
Make sure you have read the HOW TO POST thread

AJenbo
CodeLite Enthusiast
Posts: 41
Joined: Mon May 22, 2017 12:06 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Code style for CodeLite

Post by AJenbo » Sat Jun 03, 2017 11:31 pm

Thanks that helped clarify some things.

AJenbo
CodeLite Enthusiast
Posts: 41
Joined: Mon May 22, 2017 12:06 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Code style for CodeLite

Post by AJenbo » Mon Jun 05, 2017 2:38 pm

Maybe it be a good idea to also create a .clang_format file:
http://clangformat.com/

User avatar
eranif
CodeLite Plugin
Posts: 5927
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Code style for CodeLite

Post by eranif » Sat Jun 10, 2017 9:18 pm

A good idea, I wonder if you should add an option to "export" the current clang-format settings to a file
Make sure you have read the HOW TO POST thread

AJenbo
CodeLite Enthusiast
Posts: 41
Joined: Mon May 22, 2017 12:06 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Code style for CodeLite

Post by AJenbo » Mon Jun 12, 2017 10:59 am

Sounds like a worthy cause, the same could be done for phpcsfixer and phpcbf. It's also possible to do for phpcs and phpmd though at the moment I haven't made any config option so they actually rely on external tools that are able to do this (there is a descent online tool for both so it's less pressing, phpcbf and phpcs also read the same configuration).

AJenbo
CodeLite Enthusiast
Posts: 41
Joined: Mon May 22, 2017 12:06 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Code style for CodeLite

Post by AJenbo » Mon Jun 12, 2017 11:01 am

I already have a branch where about a third of the phpcsfixer options are exposed, but it still needs some work before it's ready to merge.

Post Reply