trunk-recorder icon indicating copy to clipboard operation
trunk-recorder copied to clipboard

clang-format and CONTRIBUTING file

Open leee opened this issue 4 years ago • 1 comments

I've been holding off on running and submitting a clang-format because I know there's one big PR pending from @rosecitytransit, and don't want them to be blocked on having to deal with merging all that. Afterwards though, I think some housekeeping in the near future is in order.

I'd like to propose implementing a more complete style as well.

clang-format supports a few styles included out of the box, examples of which can be seen here and here. Of those, I've never been a fan of the GNU indentation style, which Mozilla, WebKit, Microsoft, and of course GNU follow. I also think the project has generally followed K&R style indentation.

That leaves LLVM, Google, and Chromium. Between the latter two which I believe are nearly identical in most ways, I'm less a fan of Chromium splitting up parameters into new lines of their own, but do admit that this makes them easier to read.

MongoDB also has a fantastic .clang-format which may be of interest.


A CONTRIBUTING file could also be made to explain conventions, formatting (and what clang-format version to use), how changes should be submitted, and a reminder of the project's license. For extra credit, something like the Contributor Covenant too.

leee avatar May 20 '21 04:05 leee

Let me go check those out and look at the results. I do have a super simple one up here: https://github.com/robotastic/trunk-recorder/blob/master/.clang-format

Is there a good CONTRIBUTING file to start from? or a template you know of?

I really like the Contributor Covenant idea

robotastic avatar May 28 '21 02:05 robotastic