Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tinydtls-dev] Is there a clang-format for the project?

Hey Olaf,

well, how about the attached one then? I tried my best to match to your preferences, but would be cool to get back your version of it with modifications. Help here: https://clang.llvm.org/docs/ClangFormatStyleOptions.html

tldr; install clang-format, put this file in the sources root (the formater will escalate dirs until it finds the configuration) and just run clang-format <file.c|h>

P.S. I'm using eclipse myself and I have a plugin + a nice shortcut to just apply to format on either a selection or the whole file that I'm working on.

Cheers,
-Dragos

On Thu, Sep 27, 2018 at 5:39 PM Olaf Bergmann <bergmann@xxxxxxx> wrote:
Hi Dragos,

Dragos Vingarzan <vingarzan@xxxxxxxxx> writes:

> I'm working on porting the library to an embedded system and I'm
> confused about the code formatting. Well, the obvious thing is that
> the coding style from CONTRIBUTING.md is more of a wishlist than hard
> rules at the moment...

good to hear that

a) your are working on a port and

b) you care about coding style.

> I'm not super strict myself either, but I love using tools, like
> clang-format. And that got me used to very neatly arranged code. So I
> was wondering if anyone has already an input for that, such that I'd
> format my code automatically before submitting.

Yes, in the past, I have not been successful in enforcing the coding
style from CONTRIBUTING.md as people tend to just ignore these. Sigh.
But yes, at some, this needs a thorough cleanup. I have not worked with
clang-format, so I cannot provide a spec right now :-(

Grüße
Olaf


--
Dragos Vingarzan

Attachment: .clang-format
Description: Binary data


Back to the top