From 894a869e7b5d7c1c04b9583e706e21cef6a1d6d6 Mon Sep 17 00:00:00 2001 From: Eric Fiselier Date: Wed, 11 Oct 2017 17:38:16 -0600 Subject: Add Google-style .clang-format file. It would be nice if the repository contained a clang-format config file so that PR submitters could use tooling to correctly format their code match Googles/abseils style. This also makes it easier for reviewers to specify what coding style should be used. ie the one the tooling produces. The clang-format file is the default Google configuration as dumped by `clang-format`. I'm not sure abseil will want the exact same options, but it seemed like the right starting place. --- .clang-format | 4 ++++ CONTRIBUTING.md | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .clang-format diff --git a/.clang-format b/.clang-format new file mode 100644 index 000000000000..06ea346a1067 --- /dev/null +++ b/.clang-format @@ -0,0 +1,4 @@ +--- +Language: Cpp +BasedOnStyle: Google +... diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c9c89bbc4248..865da86d7cac 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -47,7 +47,8 @@ will be expected to conform to the style outlined made and **why** it was made. Link to a GitHub issue if it exists. * Don't fix code style and formatting unless you are already changing that - line to address an issue. PRs with irrelevant changes won't be merged. If + line to address an issue. Formatting of modified lines may be done using + `git clang-format`. PRs with irrelevant changes won't be merged. If you do want to fix formatting or style, do that in a separate PR. * Unless your PR is trivial, you should expect there will be reviewer comments -- cgit 1.4.1