← Back to team overview

kicad-developers team mailing list archive

Re: Code style autoformat

 

Dear Kevin&All,

On Samstag, 22. September 2018 15:09:41 CEST Kevin Cozens wrote:
> On 2018-09-22 07:18 AM, Zoltan Gyarmati wrote:
> > As Seth (rightfully) pointed out, my patch didn't fully follow the coding
> > guidelines. Before i started to manually fix the issues, i looked whether
> > there is any infrastructure for autoformatting in the source tree, and i
> > found:
> > * a clang-format config file (_clang-format)
> > * an uncrustify config file (uncrustify.cfg)
> > * a script for checking code style in changed files (tools/checkcoding.py)
> 
> [snip]> So my questions are:
> > * Is there any canonized ruleset for autoformatting the code?
> 
> I don't know if there is any official ruleset for use with auto-formatting
> code. FWIW, there is one program that I've used to format (mostly C) code
> that wasn't mentioned. The program is called indent.
> 
> Out of the box indent may not format the code the way you want it to appear.
> It has a lot of options, that you can put in to a file, which allow you to
> customize how it will reformat code.

Yep, there is a fair amount of tools out there, my question was more about 
whether there is one which is "officially" used and configured for the Kicad 
codebase (especially as there are 2 config files present in the source tree 
for the 2 mentioned tools).

Regards,
Zoltan Gyarmati




References