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 »

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: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Code style for CodeLite

Post by eranif »

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 »

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 »

Maybe it be a good idea to also create a .clang_format file:
http://clangformat.com/
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Code style for CodeLite

Post by eranif »

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 »

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 »

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