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 all the things #12391

Closed
zeke opened this issue Mar 21, 2018 · 1 comment
Closed

clang-format all the things #12391

zeke opened this issue Mar 21, 2018 · 1 comment

Comments

@zeke
Copy link
Contributor

zeke commented Mar 21, 2018

We recommend using clang-format for linting C/C++/Objective-C code. Rather than burying this recommendation in a doc somewhere, perhaps we should enforce this style.

A rough outline of how this could go down:

  1. clang-format all the existing code
  2. add clang-format as part of the existing lint-cpp task
  3. Add a clang-format pre-commmit git hook using husky
  4. Update or remove docs/development/clang-format.md

Considerations:

@ckerr:

The thing to avoid is having patches that intermix formatting changes and code changes, because that makes things hairy when you need to go back through the log looking for something in the diffs. So the best you can do is have a flag day patch that reformats everything and then turn clang-format into the linter at the same time

@codebytere:

my initial opinion would be to think about integrating it around the same time we attempt to integrate linting for objc code

@zeke
Copy link
Contributor Author

zeke commented Apr 22, 2018

Excellent work, @codebytere! 🙌

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