← Back to team overview

kicad-developers team mailing list archive

Re: Code style autoformat


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
* 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.



http://www.ve3syb.ca/               | "Nerds make the shiny things that
https://www.patreon.com/KevinCozens | distract the mouth-breathers, and
                                    | that's why we're powerful"
Owner of Elecraft K2 #2172          |
#include <disclaimer/favourite>     |             --Chris Hardwick

Follow ups