Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clang-format and CONTRIBUTING file #481

Open
leee opened this issue May 20, 2021 · 1 comment
Open

clang-format and CONTRIBUTING file #481

leee opened this issue May 20, 2021 · 1 comment

Comments

@leee
Copy link
Contributor

leee commented May 20, 2021

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.

@robotastic
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants